Newtonsoft.Json.dll conflicts between Visual Studio 12.0 Blend and MVC 5 web project VS 2013

asp.net-mvc-5, json.net, visual-studio-2013

Solution

I got that error because I had an additional

<ItemGroup>
  <Reference Include="Newtonsoft.Json">
    <HintPath>..\packages\Newtonsoft.Json.5.0.6\lib\net45\Newtonsoft.Json.dll</HintPath>
  </Reference>
  <Reference Include="Owin">
    <HintPath>..\packages\Owin.1.0\lib\net40\Owin.dll</HintPath>
    <Private>True</Private>
  </Reference>
</ItemGroup>

in my Web.csproj directly below the usual references which already contained the correct reference to the latest Newtonsoft.Json.dll. In VS only the reference to the newer assembly was shown.

Solution was: I moved the valid Owin reference to the main references ItemGroup and deleted the outdated Newtonsoft.Json.dll reference (manually editing the csproj file).

Cause of the error message: On my machine the HintPath of the old Newtonsoft.Json.dll did not exist, therefor MSBuild was looking elsewhere and took the Blend version.

(BTW: To see why and where MSBuild is looking for a certain assembly use TOOLS -> Options -> Projects and Solutions -> Build and Run -> und set the "MSBuild project build output verbosity" setting to "Detailed" and rebuild the project.)

Problem

I have a asp.net mvc 5 project in VS2013, I updated the nuget packages of everything to latest then I run into this error ``` Error 2 The type 'Newtonsoft.Json.Serialization.CamelCasePropertyNamesContractResolver' exists in both 'c:\Program Files (x86)\Microsoft Visual Studio 12.0\Blend\Newtonsoft.Json.dll' and '{path to my project}\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll' ``` Does anyone else run into this.

Original source