Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I updated json.net in all projects in my solution and after I get 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 it trying to load json.net from the Blend folder and how do I get around this issue?

Thanks.

like image 556
Kyle Avatar asked Feb 07 '14 20:02

Kyle


1 Answers

In my case, the problem was that there were two references to two different versions of Newtonsoft.Json.dll in my project. This wasn't apparent by looking at the references in the Solution tree view: you have to examine the csproj file.

To fix this:

  1. right-click the project in Visual Studio, and select Unload Project
  2. search the MSBuild file for references to Newtonsoft.Json
  3. delete the reference the older version of the library
  4. right-click the project and reload it.
like image 192
Samuel Jack Avatar answered Nov 10 '22 00:11

Samuel Jack