Could not load file or assembly 'Newtonsoft.Json, Version=12.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)
Doing my head in trying to find this reference. I am running a .NET Framework v4.5 project, and then importing the DLL into an aspx page.
The DLL contains a class used to connect to the Google APIs - specifically for the Google Calendar.
I've tried removing all the NuGet references and re-installing. I've ensured they are all updated to the latest stable version. The Newton.JSON library is specifically set to v13.0.1.
My packages.config file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Google.Apis" version="1.51.0" targetFramework="net45" />
<package id="Google.Apis.Auth" version="1.51.0" targetFramework="net45" />
<package id="Google.Apis.Calendar.v3" version="1.51.0.2312" targetFramework="net45" />
<package id="Google.Apis.Core" version="1.51.0" targetFramework="net45" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net45" />
<package id="System.Net.Http" version="4.0.0" targetFramework="net45" />
</packages>
I've seen others suggesting updating the web.config file in the following folder: C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config I have no idea why though. There are no references to the Newton.JSON library in there.
Where to next?
EDIT: I have resolved this as recommended below by editing the web.config of the website to point old references to the new one, however I now receive the following error:
Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'