How to fix the "Internal server error: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0" error?
Last modified:
Q:
I am gerring this error on page load. I have the .dll in bin folder, is newer version than 6.0
Error: "Internal server error: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)"
StatusCode: 500
A:
1. Automatic assembly binding redirection should be turned on or manual binding should be added.
You can read more about this in the following MSDN articles:
A great article explaining "what should I do if" can be found here: Assembly Binding Redirect to a lower version.
2. Sometimes we receive this error on building demo projects too even if binding redirects are properly configured.
In this case, clearing the Nuget packets cache and rebooting should help.
You can clear your development computer's NuGet package cache using Visual Studio menu Tools → Options → NuGet Package Manager → General: Clear Package Cache button.