json.net - Why is .Net trying to load the wrong version of Newtonsoft.Json? -
in project have following packages installed:
- jwt v2.3.2 (https://www.nuget.org/packages/jwt/2.3.2)
- newtonsoft.json v9.0.1 (https://www.nuget.org/packages/newtonsoft.json/9.0.1)
when program runs, throws exception
system.io.fileloadexception not load file or assembly 'newtonsoft.json, version=10.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) @ jwt.serializers.jsonnetserializer.serialize(object obj) @ jwt.jwtencoder.encode(idictionary`2 extraheaders, object payload, byte[] key) ...
why .net attempting load version of newtonsoft.json. jwt requires v6.0.4 or greater have satisfied. both of these packages installed , working before newtonsoft.json had v10. how runtime know v10 exists?
i solved immediate problem adding binding redirect down v9 find root of problem.
i ran update-package newtonsoft.json -reinstall
, looked @ pending changes see if of projects had reference v10 couldn't find anything.
check .*csproj file right click -> unload project -> right click -> edit .*csproj in visual studio or open text editor.
some times save reference old version of package
Comments
Post a Comment