Link to different versions of Json.NET dll

I play with my mvc project.

  • I sketched a package called SocialAuth.Net into the project, which in turn uses Newtonsoft.Json.dll 4.0.0.0 (older) as one of its dependencies.

  • Then, since I also need Json.Net, I need a new version, so I am Nugeted Json.NET, which has a newer version 4.5.0.0 (newer).

Then the problem arises. In my razor mode "ViewBag.title = ...." it has a red underline saying:

Warning 1 c: \ users \ admin \ documents \ visual studio 2010 \ Projects \ WebApp \ WebApp \ Views \ Home \ Index.cshtml: ASP.NET runtime error: Failed to load file or assembly "Newtonsoft.Json, Version = 4.5 .0.0, Culture = Neutral, PublicKeyToken = 30ad4fe6b2a6aeed 'or one of its dependencies. The defined assembly manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

This is the Json part of my web.config:

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

So,

  • I went to the "Links", checked and found Newtonsoft.Json was 4.0.0.0 (maybe came from SocialAuth.Net), and I deleted it and added the 4.5.0.0 link that I got from Nuget.

  • I went into the WebApp / bin / debug / folder and deleted everything, and then rebuilt the project.

, webapp, Newton.Json 4.0.0.0 bin/debug/ , Nuget 4.5.0.0. . .

, dll? .

-----------------------------------

, , , Json.Net( 4.5) , . , .

GAC, , 2 , , , , -, web.config ?

+5
1

SocialAuth.Net ‑IgnoreDependencies, , Json.Net.

SocialAuth.Net Json.Net(v4.5) .

0

All Articles