title: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. Manifest definition does not match the assembly reference
body: <p>Things I've tried after searching:</p>
  
  <ol>
  <li><p>in Web.Config put a binding on the old version:</p>
  
  <pre><code>&lt;dependentAssembly&gt;
      &lt;assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" /&gt;
      &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.1.0" /&gt;
  &lt;/dependentAssembly&gt;
  </code></pre></li>
  <li><p>Edit my .csproj file to make sure there is only one Newtonsoft reference</p>
  
  <pre><code>&lt;Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL"&gt;
     &lt;HintPath&gt;..\packages\Newtonsoft.Json.6.0.1\lib\net45\Newtonsoft.Json.dll&lt;/HintPath&gt;
     &lt;SpecificVersion&gt;False&lt;/SpecificVersion&gt;
     &lt;Private&gt;True&lt;/Private&gt;
  &lt;/Reference&gt;
  </code></pre></li>
  <li><p>Search my computer for every Newtonsoft.Json.dll and delete every non 6.0.1 version and delete the contents of my temp folder</p></li>
  <li><p>Repair/Reinstall the package in nuget manager console</p></li>
  </ol>
  
  <p>It succeeds on building, but gets the error when going to the site.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>ok, so then I tried to reinstall like every nuget package, and it seems to have added back the 4.5 version of the newtonsoft.json.dll, but I'm getting the same error. My project's Target freamework is .NET 4.5.1 and here is the stack trace I'm getting now:</p>
  
  <blockquote>
    <p>Server Error in '/' Application.    </p>
    
    <p>Could not load file or assembly <code>Newtonsoft.Json</code> or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: <code>0x80131040</code>)</p>
    
    <p>Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. </p>
    
    <p>Exception Details: <code>System.IO.FileLoadException</code>: Could not load file or assembly <code>Newtonsoft.Json</code> or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: <code>0x80131040</code>)</p>
    
    <p>Source Error: </p>
    
    <p>An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.</p>
    
    <p>Assembly Load Trace: The following information can be helpful to determine why the assembly <code>Newtonsoft.Json</code> could not be loaded.</p>
  </blockquote>
  
  <pre><code>=== Pre-bind state information ===
  LOG: DisplayName = Newtonsoft.Json
  (Partial)
  WRN: Partial binding information was supplied for an assembly:
  WRN: Assembly Name: Newtonsoft.Json | Domain ID: 2
  WRN: A partial bind occurs when only part of the assembly display name is provided.
  WRN: This might result in the binder loading an incorrect assembly.
  WRN: It is recommended to provide a fully specified textual identity for the assembly,
  WRN: that consists of the simple name, version, culture, and public key token.
  WRN: See whitepaper http://go.microsoft.com/fwlink/?LinkId=109270 for more information and common solutions to this issue.
  LOG: Appbase = file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/
  LOG: Initial PrivatePath = c:\users\user\documents\visual studio 2013\Projects\foo\bar\bin
  Calling assembly : (Unknown).
   ===
  LOG: This bind starts in default load context.
  LOG: Using application configuration file: c:\users\user\documents\visual studio 2013\Projects\foo\bar\web.config
  LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
  LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json.DLL.
  LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json/Newtonsoft.Json.DLL.
  LOG: Attempting download of new URL file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/bin/Newtonsoft.Json.DLL.
  LOG: Using application configuration file: c:\users\user\documents\visual studio 2013\Projects\foo\bar\web.config
  LOG: Using host configuration file: C:\Users\user\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
  LOG: Redirect found in application configuration file: 4.5.0.0 redirected to 6.0.1.0.
  LOG: Post-policy reference: Newtonsoft.Json, Version=6.0.1.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed
  LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json.DLL.
  LOG: Attempting download of new URL file:///C:/Users/user/AppData/Local/Temp/1/Temporary ASP.NET Files/root/48686d37/9d7a6572/Newtonsoft.Json/Newtonsoft.Json.DLL.
  LOG: Attempting download of new URL file:///c:/users/user/documents/visual studio 2013/Projects/foo/bar/bin/Newtonsoft.Json.DLL.
  WRN: Comparing the assembly name resulted in the mismatch: Major Version
  ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
  </code></pre>
  
  <p>Stack Trace: </p>
  
  <pre><code>[FileLoadException: Could not load file or assembly 'Newtonsoft.Json' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)]
  
  [FileLoadException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.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)]
         System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
         System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34
         System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152
         System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77
         System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) +16
         System.Reflection.Assembly.Load(String assemblyString) +28
         System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38
  
  [ConfigurationErrorsException: Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.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)]
         System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752
         System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218
         System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130
          System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170
         System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91
         System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded) +285
         System.Web.Compilation.BuildManager.ExecutePreAppStart() +153
         System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516
  
  [HttpException (0x80004005): Could not load file or assembly 'Newtonsoft.Json, Version=6.0.1.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)]
         System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9913572
         System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
         System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
  
  Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.18408
  </code></pre>