Today, I met a problem with the pit, and I thought about it for a long time ...
Because of the need to reference a third-party class library, the three-way class library refers to the Newtonsoft.Json.dll version 7.0.0 and my project references the Newtonsoft.Json.dll version 4.5.0, so that two references cause a conflict. All references are OK, the compile-time prompt "Newtonsoft.Json.Linq" is not referenced, but this is clearly quoted. Try to use NuGet Update, update to the latest version of 9.0.0, after the success of the update can be compiled successfully, but this kind of problem occurs when accessing.
The Final Solution, modify Web. config, here is just to tell you the format, just add the full dependentassembly content.
<Runtime> <assemblybindingxmlns= "Urn:schemas-microsoft-com:asm.v1"> <dependentassembly> <assemblyidentityname= "Webgrease"PublicKeyToken= "31bf3856ad364e35"Culture= "neutral" /> <BindingRedirectoldversion= "0.0.0.0-1.5.2.14234"newversion= "1.5.2.14234" /> </dependentassembly> <dependentassembly> <assemblyidentityname= "Newtonsoft.json"PublicKeyToken= "30ad4fe6b2a6aeed"Culture= "neutral" /> <BindingRedirectoldversion= "0.0.0.0-7.0.0.0"newversion= "7.0.0.0" /> </dependentassembly> </assemblybinding> </Runtime>
Resolves a file or assembly that failed to load "Newtonsoft.json ..." or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)