title: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0 in unit test
body: <p>I am trying to unit test a project that has dependencies on Json.Net and SignalR.  For some reason I am unable to get many of these unit tests to run. Ever since I've updated Json.Net to version 9.0.0, I am getting an exception that says:</p>
  
  <blockquote>
    <p>An exception of type 'System.IO.FileLoadException' occurred in mscorlib.dll but was not handled in user code</p>
    
    <p>Additional information: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) </p>
  </blockquote>
  
  <hr>
  
  <p>I can reproduce this behavior with a clean project.  Here are the steps to reproduce:</p>
  
  <ul>
  <li>Use Visual Studio 2015 Update 3 </li>
  <li>Go to <strong>File->New->Project</strong></li>
  <li>Select <strong>Templates->Visual C#-> Test -> Unit Test Project</strong></li>
  <li>Right click the project, select properties, and change the framework to <strong>.NET Framework 4.6.1</strong></li>
  <li>create a new file at the root of the project named <strong>project.json</strong></li>
  <li>Set the content of <strong>project.json</strong> to the following:  </li>
  </ul>
  
  <p>.</p>
  
  <pre><code>{
    "dependencies": {
      "Microsoft.AspNet.SignalR.Client": "2.2.1",
      "Microsoft.AspNet.SignalR.Core": "2.2.1",
      "Newtonsoft.Json": "9.0.1"
    },
    "frameworks": {
      "net451": {},
      "net461": {}
    },
    "runtimes": {
      "win": {},
      "win-x86": {},
      "win-x64": {}
    }
  }
  </code></pre>
  
  <ul>
  <li>Change <strong>UnitTest1.cs</strong> (provided by the scaffolding) to the following:</li>
  </ul>
  
  <p>.</p>
  
  <pre><code>using Microsoft.VisualStudio.TestTools.UnitTesting;
  
  namespace UnitTestProject1
  {
      [TestClass]
      public class UnitTest1
      {
          [TestMethod]
          public void TestMethod1()
          {
              var conman = Microsoft.AspNet.SignalR.GlobalHost.ConnectionManager;
          }
      }
  }
  </code></pre>
  
  <ul>
  <li>Close and reopen visual studio(this is necessary to load the dependencies using project.json)</li>
  <li>Rebuild the project</li>
  <li>select the test method, and press <strong>CTRL+R+T</strong></li>
  </ul>
  
  <p>The error should appear.</p>
  
  <p>I have no idea how to fix this.  I've tried playing around with the binding bindingRedirects, and nothing has made the error go away.  Reinstalling the package doesn't make any sense, because I can reproduce this with a clean project.  </p>
  
  <p>My fear is that I'll have to revert back to an earlier version of Json.Net</p>