title: EF 6.13 add-migration throw exception on VS2017, Microsoft.Build.Framework
body: <p>I get this error when i typing add migration. The ApplicationDbContext exists in another project while migration file exist in the web application project.</p>
  
  <p>If I remember right it has worked before but now it stopped to work.
  I have tried restart visual studio, run it as administrator. reinstall EF 6.11, 6.13 and 6.20.</p>
  
  <p>Visual Studio Version 15.8.5, Build Tool 15.1</p>
  
  <p>The migration exists in the startup project and the package manager is also set on the startup project.</p>
  
  <p>I have even tried to repair Visual Studio and after I also tried uninstall and then install but nothing works.</p>
  
  <p>I tried the the solution where I edit devenv.exe.config which did not work
  <a href="https://github.com/aspnet/EntityFramework6/issues/382" rel="nofollow noreferrer">https://github.com/aspnet/EntityFramework6/issues/382</a></p>
  
  <pre><code>add-migration AddedUserFax
      System.TypeInitializationException: The type initializer for 'Company.SoftwareX.Contexts.ApplicationDbContext' threw an exception. ---&gt; System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Build.Framework, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
         at Company.SoftwareX.Database.Contexts.ApplicationDbContext..cctor()
         --- End of inner exception stack trace ---
         at Company.SoftwareX.Database.Contexts.ApplicationDbContext..ctor() in C:\Projects\Visual Studio\Project\Company.SoftwareX.Database\ApplicationDbContext.cs:line 110
      --- End of stack trace from previous location where exception was thrown ---
         at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
         at System.Data.Entity.Infrastructure.DbContextInfo.CreateInstance()
         at System.Data.Entity.Infrastructure.DbContextInfo..ctor(Type contextType, DbProviderInfo modelProviderInfo, AppConfig config, DbConnectionInfo connectionInfo, Func`1 resolver)
         at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext, DatabaseExistenceState existenceState, Boolean calledByCreateDatabase)
         at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration)
         at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration migrationsConfiguration)
         at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()
         at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
         at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
         at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
         at System.Data.Entity.Migrations.Design.ToolingFacade.Scaffold(String migrationName, String language, String rootNamespace, Boolean ignoreChanges)
         at System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges)
         at System.Data.Entity.Migrations.AddMigrationCommand.&lt;&gt;c__DisplayClass2.&lt;.ctor&gt;b__0()
         at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
      The type initializer for 'Company.SoftwareX.Database.Contexts.ApplicationDbContext' threw an exception.
  </code></pre>