Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' asp.net asp.net

Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed'


In package manager console execute: Update-Package –reinstall Newtonsoft.Json.

UPDATE

I originally posted this as a comment but as @OwenBlacker suggested I'll just put it here:

If you still get an error after doing this, then what worked for me eventually is that I deleted Json.Net's <dependentAssembly> section from my .config file. Reinstall brings it back if it's not there and apparently you need to delete it. Until there will be a normal solution in the package itself, I'm afraid this manual step is a must.

Note: Please read the comments below before doing this.

As per René's comment below BE AWARE that the command posted in the answer will reinstall the package in every project in your solution. So if you use the Newtonsoft.Json package in several projects and maybe use different versions, just executing the above command might have unwanted consequences.


To everyone having problems with Newtonsoft.Json v4.5 version try using this in web.config or app.config:

<runtime>    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">       <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>    </assemblyBinding></runtime>

IMPORTANT: Check that the configuration tag of your config file has no namespace attribute (as suggested in https://stackoverflow.com/a/12011221/150370). Otherwise, assemblyBinding tags will be ignored.


The key point is referencing right version in your config file.

Steps;

1- look at what is the version of your Newtonsoft.Json.dll in the project reference property what ever the version in your package folder (For example mine is 7.0.1 and the reference Version is 7.0.0.0)

2- look at what the project expect from you in the exception (mine is 6.0.0.0)

3- Add dependent assembly to your config file as it should be..

  <dependentAssembly>    <assemblyIdentity name="Newtonsoft.Json"  publicKeyToken="30AD4FE6B2A6AEED" culture="neutral"/>    <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="7.0.0.0"/>  </dependentAssembly>