title: Installer unable to find NewtonSoft JSON.net dependency in local directory
body: <p>Hello internet people,</p>
  
  <p>I am running into an issue with version mismatches with the Json.net package that I am thus far unable to troubleshoot.</p>
  
  <p>The issue: I am trying to install a testing mock framework that depends on Newtonsoft's Json.net. I grabbed Json.net version 6.0.3 from Nuget through Visual Studio. According to the installer's packages.config, it should be looking for Newtonsoft.json v. 6.0.3. No obvious problems there.</p>
  
  <p>However when I run the generated exe I get the following error:</p>
  
  <pre><code>Unhandled Exception: System.Reflection.TargetInvocationException: Exception has been  
  thrown by the target of an invocation. ---&gt; System.IO.F
  ileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=4.5.0.0, 
  Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or on
  e of its dependencies. The located assembly's manifest definition does not match the 
  assembly reference. (Exception from HRESULT: 0x80131040)
  at System.Net.Http.Formatting.BaseJsonMediaTypeFormatter..ctor()
  at System.Net.Http.Formatting.JsonMediaTypeFormatter..ctor()
  at System.Net.Http.Formatting.MediaTypeFormatterCollection.CreateDefaultFormatters()
  at System.Web.Http.HttpConfiguration.DefaultFormatters()
  at System.Web.Http.HttpConfiguration..ctor(HttpRouteCollection routes)
  at System.Web.Http.HttpConfiguration..ctor()
  at JSendMock.Service.Startup.Configuration(IAppBuilder appBuilder)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo cultur
  e)
  at Owin.Loader.DefaultLoader.&lt;&gt;c__DisplayClass12.&lt;MakeDelegate&gt;b__b(IAppBuilder builder)
  at Owin.Loader.DefaultLoader.&lt;&gt;c__DisplayClass1.&lt;LoadImplementation&gt;b__0(IAppBuilder builder)
  at Microsoft.Owin.Hosting.Engine.HostingEngine.ResolveApp(StartContext context)
  at Microsoft.Owin.Hosting.Engine.HostingEngine.Start(StartContext context)
  at Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(StartOptions options)
  at Microsoft.Owin.Hosting.Starter.HostingStarter.Start(StartOptions options)
  at Microsoft.Owin.Hosting.WebApp.StartImplementation(IServiceProvider services, StartOptions options)
  at Microsoft.Owin.Hosting.WebApp.Start(StartOptions options)
  at Microsoft.Owin.Hosting.WebApp.Start[TStartup](StartOptions options)
  at Microsoft.Owin.Hosting.WebApp.Start[TStartup](String url)
  at JSendMock.Service.Program.Main(String[] args)
  </code></pre>
  
  <p>So the obvious explanation to me is that it seems to be looking for the wrong version or looking in the wrong place. The 6.0.3 Newtonsoft.json version that the executable should be searching for is in the same directory as the executable. There is no Newtonsoft.json in the global assembly cache, and there are no other obvious factors influencing the search. Beyond this, I am mystified as to why it is getting a version mismatch, or how to troubleshoot this issue. </p>
  
  <p>There are several other copies of Newtonsoft.json on the same machine in different directories, from a number of different versions. I have tried replacing these with copies of 6.0.3, to test whether the executable was somehow pointing to a different copy of the Newtonsoft.json dll. Beyond that, I am unsure how to troubleshoot.</p>
  
  <p>Any help is appreciated.</p>