Мой проект недавно начал выдавать следующую ошибку:
Unexpected error: Could not load type 'Newtonsoft.Json.Serialization.CamelCaseNamingStrategy' from assembly 'Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'.
at System.Reflection.CustomAttribute._GetPropertyOrFieldData(RuntimeModule pModule, Byte** ppBlobStart, Byte* pBlobEnd, String& name, Boolean& bIsProperty, RuntimeType& type, Object& value)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeType type, RuntimeType caType, Boolean inherit)
at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttributes[T](ICustomAttributeProvider attributeProvider, Boolean inherit)
at Newtonsoft.Json.Utilities.ReflectionUtils.GetAttribute[T](ICustomAttributeProvider attributeProvider, Boolean inherit)
at Newtonsoft.Json.Serialization.JsonTypeReflector.GetAttribute[T](Type type)
at Newtonsoft.Json.Utilities.ThreadSafeStore`2.AddValue(TKey key)
at Newtonsoft.Json.Utilities.ThreadSafeStore`2.Get(TKey key)
at Newtonsoft.Json.Serialization.DefaultContractResolver.CreateContract(Type objectType)
at Newtonsoft.Json.Serialization.DefaultContractResolver.ResolveContract(Type type)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonConvert.DeserializeObject(String value, Type type, JsonSerializerSettings settings)
at Newtonsoft.Json.JsonConvert.DeserializeObject[T](String value, JsonSerializerSettings settings)
at Extension.Command.ClientInitializer() in C:\project\Command.cs:line 18
in Command.Initializer
Я действительно не знаю, что я мог изменить, чтобы это появилось.
Я использую fody.costura, чтобы связать все мои зависимости, и я удостоверился, что они связаны.
Вот свойства зависимости Newtonsoft.Json:
Name : Newtonsoft.Json
Aliases : global
Copy Local : True
Culture :
Description : Json.NET is a popular high-performance JSON framework for .NET
Embed Interop Types : False
File Type : Assembly
Identity : Newtonsoft.Json
Path : C:\project\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll
Resolved : True
Runtime Version : v4.0.30319
Specific Version : True
Strong Name : True
Version : 12.0.0.0
Мой проект - .NET Framework 4.6.1 Проект библиотеки классов.
Любые предложения относительно того, в чем может быть проблема?
Спасибо!