How to resolve this conflict of two existing JSON.net?

I updated json.net in all projects in my solution and after receiving this error:

The type "Newtonsoft.Json.JsonConvert" exists in both '\ packages \ Newtonsoft.Json.6.0.1 \ lib \ net45 \ Newtonsoft.Json.dll' and 'c: \ Program Files (x86) \ Microsoft Visual Studio 12.0 \ Blend \ Newtonsoft.Json.dll

Why is he trying to download json.net from the Blend folder and how do I get around this problem?

Thanks.

+11
c # visual-studio-2013
source share
3 answers

In my case, the problem was that in my project there were two links to two different versions of Newtonsoft.Json.dll. This was not obvious if you look at the links in the decision tree view: you need to examine the csproj file.

To fix this:

  • right-click the project in Visual Studio and select "Unload Project"
  • find the MSBuild file for links to Newtonsoft.Json
  • delete the link in the old version of the library
  • right-click the project and reload it.
+26
source share

In my case, I just used the fully qualified name of the assembly:

var obj = Newtonsoft.Json.JsonConvert ...

(VS Community 2017 version 15.7.5)

0
source share

In my case, I have a duplicate, but he talked about error 6 in the project after unloading it and deleting all the duplicates, but the last one solved the problem when rebooting.

thanks

0
source share

All Articles