Failed to load file or assembly "Newtonsoft.json, version=6.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed" or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)
Description: An unhandled exception occurred during the execution of the current WEB request. Check the stack trace information For more information about the error and the source of the error in your code.  
exception Details: System.IO.FileLoadException: Failed to load file or assembly "Newtonsoft.json, version=6.0.0.0, Culture=neutral, publickeytoken= 30ad4fe6b2a6aeed "or one of its dependencies. The found assembly manifest definition does not match the assembly reference. (Exception from hresult:0x80131040)
source error: assembly load Trace: The following information helps determine why the assembly "Newtonsoft.json, version=6.0.0.0, Culture=neutral, publickeytoken=30ad4fe6b2a6aeed" failed to load.
= = = Pre-bind status information = = = log: DisplayName = Newtonsoft.json, version=6.0.0.0, Culture=neutral, Publickeytoken=30ad4fe6b2a6aeed ( fully-specified) log: Appbase = file:///G:/code/IronFuryServer/Route/log: initial PrivatePath = G:\code\IronFuryServer\Route\ Bin invocation assembly: System.Net.Http.Formatting, version=5.2.3.0, Culture=neutral, publickeytoken=31bf3856ad364e35. = = = Log: This binding starts from the default load context. LOG: Using application configuration file: G:\code\IronFuryServer\Route\web.config log: Using Host Profile: C:\Windows\Microsoft.NET\Framework64\ V4.0.30319\aspnet.config log: Use C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config's computer configuration file. LOG: Policy Post reference: Newtonsoft.json, version=6.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed log: Try to download a new URL File:///C :/windows/microsoft.net/framework64/v4.0.30319/temporary ASP. files/root/24fb3432/4a6a283a/ Newtonsoft.Json.DLL. LOG: Try to download a new URL file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/Temporary ASP. files/root/24fb3432/ 4a6a283a/newtonsoft.json/newtonsoft.json.dll. LOG: Try to download a new URL file:///G:/code/Ironfuryserver/route/bin/newtonsoft.json.dll. Warning: A mismatch occurred while comparing assembly names: Major version error: Failed to complete assembly installation (hr = 0x80131040). The probe terminates. |
Because the reference is a problem, you can't find the Newtonsoft.json in your assembly, so it takes the old version from the system tray.
The result is that the version is wrong.
First, the reference does not exist vs automatically finds the old version.
Second, the version number of the Web. config configuration is not the same as the actual desired version number.
Third, the Bin folder inside the root is the old version.
Workaround! You can remove the Newtonsoft.json from the Bin folder and use the NuGet reference again
Update Newtonsoft.json Post exception, failed to load file or assembly "Newtonsoft.json