title: Could not load file or assembly 'Microsoft.AspNet.Scaffolding.12.0' or one of its dependencies
body: <p>After pulling an old project down from source control and attempting to run it, I'm getting the following error:</p>
  
  <pre><code>=== Pre-bind state information ===
  LOG: DisplayName = Microsoft.AspNet.Scaffolding.12.0
   (Partial)
  WRN: Partial binding information was supplied for an assembly:
  WRN: Assembly Name: Microsoft.AspNet.Scaffolding.12.0 | Domain ID: 3
  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:/PROJECTS/C.App/
  LOG: Initial PrivatePath = C:\PROJECTS\C.App\bin
  Calling assembly : (Unknown).
  ===
  LOG: This bind starts in default load context.
  LOG: Using application configuration file: C:\PROJECTS\C.App\web.config
  LOG: Using host configuration file: C:\Users\C\Documents\IISExpress\config\aspnet.config
  LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\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/C/AppData/Local/Temp/Temporary ASP.NET Files/vs/566b0c0d/a2911b5/Microsoft.AspNet.Scaffolding.12.0.DLL.
  LOG: Attempting download of new URL file:///C:/Users/C/AppData/Local/Temp/Temporary ASP.NET Files/vs/566b0c0d/a2911b5/Microsoft.AspNet.Scaffolding.12.0/Microsoft.AspNet.Scaffolding.12.0.DLL.
  LOG: Attempting download of new URL file:///C:/PROJECTS/C.App/bin/Microsoft.AspNet.Scaffolding.12.0.DLL.
  ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.
  </code></pre>
  
  <p>What could be causing this?</p>
  
  <p>I've tried:</p>
  
  <ul>
  <li>Deleting bin/obj/Resharper Cache</li>
  <li>Restarting VS</li>
  <li>Looking for the dll and finding it here but I'm unable to load it as a reference for some reason; Visual Studio won't show it in File Explorer</li>
  <li>Searching for it on Nuget</li>
  <li>Finding out why this is even needed but I don't see any references in any files</li>
  </ul>
  
  <p>I'm using IISExpress; this is localhost and the error is appearing when I run the app in Release and Debug modes (classic yellow ASP.Net error).</p>
  
  <p>Full stack trace:</p>
  
  <pre><code>[BadImageFormatException: Could not load file or assembly 'Microsoft.AspNet.Scaffolding.12.0' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
     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.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +225
     System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110
     System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) +22
     System.Reflection.Assembly.Load(String assemblyString) +34
     System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48
  
  [ConfigurationErrorsException: Could not load file or assembly 'Microsoft.AspNet.Scaffolding.12.0' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
     System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +729
     System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +247
     System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +157
     System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +226
     System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +73
     System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded) +321
     System.Web.Compilation.BuildManager.ExecutePreAppStart() +170
     System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +734
  
  [HttpException (0x80004005): Could not load file or assembly 'Microsoft.AspNet.Scaffolding.12.0' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
     System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +525
     System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +118
     System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +708
  </code></pre>