First, It is not just duplicate. None of answers from following questions are working for me.
http://goo.gl/tS40cn
http://goo.gl/pH6v2T
I\'ve just updated al
Add Newtonsoft reference in my MVC project solves the problem for me.
After trying much of the above (and some other posts), I uninstalled with the package manager all of the following from the project affected:
Microsoft.AspNet.WebApi
Microsoft.AspNet.Client
Microsoft.AspNet.Core
Microsoft.AspNet.WebHost
Newtonsoft.Json
Then reinstalled Microsoft.AspNet.WebApi, which auto installed .Client, .Core, .WebHost, .Json.
check the 'Newtonsoft.Json' version in the project references. Add that version in the Web config. It will work. For Example: your Webconfig look like this:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="7.0.0.0"/>
</dependentAssembly>
If your version in References is '9.0.0.0' change to this:
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json"publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-7.0.0.0" newVersion="9.0.0.0"/>
</dependentAssembly>
I know this is old, but I just ran into the same problem. My issue was that multiple projects in the solution used Newtonsoft.Json, but some were at different versions. I updated all of them to the most recent (9.0.1 as I type) and the problem went away.
Anyway... if anyone is still dealing with this, make sure to update the package in EVERY project in the solution.
HTH
In my case, the following code was present in my local debug version of the solution, but not in my live server version of code. Adding the code to my server Web.config file fixed the problem.
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
<bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
</dependentAssembly>
</assemblyBinding>