This error is driving me crazy!!
Here is the error message:
[FileLoadException: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
I have a WebApi and a Web project both using .NET Framework 4.5.1 . My application builds successfully but when I run the Web app I get the error message above. I have tried many things I have found on Google & Stackoverflow in regards to this error but no success.
packages.config - <package id="Newtonsoft.Json" version="6.0.4" targetFramework="net451" />
web.config - <dependentAssembly> <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" /> </dependentAssembly>
I have tried removing the Newtonsoft.Json.dll and re-adding it but I still get the same error.
I would appreciate all help in trying to resolve this issue.
Newtonsoft.Json is included in the packages.config as part of the default MVC/WebAPI project.
The package is also included in the packages directory but for some reason NuGet package manager doesn't seem to know that it is installed.
I fixed this problem by:
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.