title: Can't Enable-Migrations. Throws System.BadImageFormatException: Could not load file or assembly
body: <p>I can't enable EF migrations!</p>
  
  <p>Using the package manager console, it throws the following:</p>
  
  <p><code>PM&gt; Enable-Migrations
  System.BadImageFormatException: Could not load file or assembly 'MyApp' or one of its dependencies. Index not found. (Exception from HRESULT: 0x80131124)
  File name: 'MyApp' ---&gt; System.BadImageFormatException: Index not found. (Exception from HRESULT: 0x80131124)
     at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
     at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)
     at System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)
     at System.Reflection.Assembly.Load(String assemblyString)
     at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.LoadAssembly()
     at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindType[TBase](String typeName, Func</code>2 filter, Func<code>2 noType, Func</code>3 multipleTypes, Func<code>3 noTypeWithName, Func</code>3 multipleTypesWithName)
     at System.Data.Entity.Migrations.Design.ToolingFacade.GetContextTypeRunner.RunCore()
     at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()</p>
  
  <pre><code>Could not load file or assembly 'MyApp' or one of its dependencies. Index not found. (Exception from HRESULT: 0x80131124)
  </code></pre>
  
  <p>Also:<br>
  1. My default project (in the PM CONSOLE) is 'MyApp'<br>
  2. The solution only has 'MyApp' <br>
  3. The class inheriting from DbContext is in 'MyApp.Models'<br>
  4. I also tried creating a new solution and then copy pasted all classes to it and it threw the same error<br><br></p>
  
  <p>What is happening?<br>
  I once enabled migrations in this project in the past, but two days later I deleted all migration stuff from it because it wasn't necesary. But now I really need them</p>