-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
A strongly-named assembly is required. #207
Comments
Strong-naming NuGet packages is no longer recommended. If you need a strong-named package chain, please consider using https://www.nuget.org/packages/strongnamer instead. |
When using this NuGet package (strongnamer), the specified error occurs when you try to call AuthenticationApiClient.GetTokenAsync. If you do not use this package, the error occurs earlier (when you start the application) |
Did you follow the directions here: https://github.com/dsplaisted/strongnamer |
Yes, I followed the directions. All three assemblies (Auth0.AuthenticationApi, Auth0.ManagamentApi, Auth0.Core) that I use in my application are signed during the build. But getting the result after GetTokenAsync, at the moment of deserializing the response, the specified error occurs. |
What "specified" error, the "cannot load" error? |
Yes, Could not load file or assembly 'Auth0.Core, .... |
Are you positive that assembly is signed? Are you also positive that the error isn't something else and you're just not reading it clearly? Would be helpful if you posted both the unsigned and the signed error messages in their entirety, including stack traces. |
Assemblies Auth0. *.dll in the bin folder of my application is signed. In the near future, I'm trying to create a minimal application that reproduces, and also attach stacktrace |
Exception Stack trace System.IO.FileLoadException
Could not load file or assembly 'Auth0.Core, Version=5.10.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
at System.Reflection.CustomAttribute._CreateCaObject(RuntimeModule pModule, IRuntimeMethodInfo pCtor, Byte** ppBlob, Byte* pEndBlob, Int32* pcNamedArgs)
at System.Reflection.CustomAttribute.CreateCaObject(RuntimeModule module, IRuntimeMethodInfo ctor, IntPtr& blob, IntPtr blobEnd, Int32& namedArgs)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimePropertyInfo property, RuntimeType caType)
at System.Attribute.InternalGetCustomAttributes(PropertyInfo element, Type type, Boolean inherit)
at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttributes[T](Object attributeProvider, Boolean inherit)
at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttribute[T](Object attributeProvider, Boolean inherit)
at Newtonsoft.Json.Serialization.JsonTypeReflector.GetAttribute[T](MemberInfo memberInfo)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Newtonsoft.Json.Serialization.JsonTypeReflector.GetJsonConverter(Object attributeProvider)
at Newtonsoft.Json.Serialization.DefaultContractResolver.SetPropertySettingsFromAttributes(JsonProperty property, Object attributeProvider, String name, Type declaringType, MemberSerialization memberSerialization, Boolean& allowNonPublicAccess)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperty(MemberInfo member, MemberSerialization memberSerialization)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateProperties(Type type, MemberSerialization memberSerialization)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateObjectContract(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonConverter[] converters)
at Auth0.Core.Http.ApiConnection.<RunAsync>d__20`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Auth0.Core.Http.ApiConnection.<GetAsync>d__15`1.MoveNext() |
So it looks like internal assembly references by not have been re-written (look at the reference string, it doesn't have a PublicKeyToken in it. Try this one instead: https://www.nuget.org/packages/Brutal.Dev.StrongNameSigner/ This NuGet package is in active development, and any signing issues you can work through with them. |
Hello @robertmclaws, I tried package Brutal.Dev.StrongNameSigner. He did not help - the same error. |
It is now again recommended to make create strong named open-source libraries:
I can create a PR for this if you would want some help with this. |
Could you take a look at this @luisrudge? |
Could not load file or assembly 'Auth0.Core, Version=5.10.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. A strongly-named assembly is required. (Exception from HRESULT: 0x80131044).
Please sign with strong name key Auth0.AuthenticationApi, Auth0.ManagamentApi, Auth0.Core and Auth0.AspNet
The text was updated successfully, but these errors were encountered: