Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with NewtonSoft.JSON version 9.0.1

We have installed Newtonsoft.JSON (version 9.0.1) in our ASP.Net MVC project.

However in our web.Config file we have the 4.5.1 version loaded. This gives us an error as we need the 7.0.0 version or higher.

We tried manually changing it but that gives us another error. Is there any way to solve this issue?

like image 483
Tuur Herman Avatar asked Aug 08 '26 08:08

Tuur Herman


1 Answers

I have the same problem, I have used lower version but after updating to Version 9.0.0 I have got your mentioned exception.

but solved the problem by adding this in Web.config:

<runtime>
<shadowCopyVerifyByTimestamp enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  <dependentAssembly>
    <assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
    <bindingRedirect oldVersion="0.0.0.0-9.0.0.0" newVersion="9.0.0.0" />
  </dependentAssembly>
</assemblyBinding>

try this and let me know your feedback.

like image 93
Aria Avatar answered Aug 11 '26 05:08

Aria