title: The model backing the 'DataContext' context has changed since the database was created
body: <p>I am trying to use Code First with Migrations. Even though there are no current changes to my model, I'm getting an exception. When I add a migration, the up and down are empty, but I get a runtime error with the message as follows: </p>
  
  <blockquote>
    <p>An exception of type 'System.InvalidOperationException' occurred in
    EntityFramework.dll but was not handled in user code</p>
    
    <p>Additional information: The model backing the 'MyDataContext' context
    has changed since the database was created. Consider using Code First
    Migrations to update the database (<a href="http://go.microsoft.com/fwlink/" rel="noreferrer">http://go.microsoft.com/fwlink/</a>?</p>
  </blockquote>
  
  <p>My architecture is as follows:</p>
  
  <ul>
  <li>DataAccess project that includes the context, fluid configurations and migrations code</li>
  <li>Model project that contains the poco classes</li>
  <li>Web API and MVC projects that each contain the connections string in their respective web.config files.</li>
  </ul>
  
  <p>Additionally I have the following code:</p>
  
  <p>DbInitializer</p>
  
  <pre><code>public static MyDataContext Create()
  {
     Database.SetInitializer(new MigrateDatabaseToLatestVersion&lt;MyDataAccess.MyDataContext, MyDataAccess.Migrations.Configuration&gt;());
     return new MyDataContext(ConfigurationManager.ConnectionStrings["MyDataContext"].ConnectionString, null);
  }
  </code></pre>
  
  <p>I started with AutomaticMigrationsEnabled = false; in the migration Configuration constructor, as it was my understanding that this would allow (and require) me to have more control over when migrations were applied.  I have also tried setting this to true but with the same result.</p>
  
  <p>I added a new migration upon receiving this error, and the Up method was empty.  I updated the database to this new migration, and a record was created in the _migrationHistory table, but I still receive the error when I attempt to run the application. Also, the seed data was not added to the database.</p>
  
  <pre><code>protected override void Seed(MyDataAccess.MyDataContext context)
  {
              IdentityResult ir;
  
              var appDbContext = new ApplicationDbContext();
              var roleManager = new RoleManager&lt;IdentityRole&gt;(new RoleStore&lt;IdentityRole&gt;(appDbContext));
              ir = roleManager.Create(new IdentityRole("Admin"));
              ir = roleManager.Create(new IdentityRole("Active"));
              ir = roleManager.Create(new IdentityRole("InActive"));
  
              var userNamager = new UserManager&lt;User&gt;(new UserStore&lt;User&gt;(appDbContext));
  
              //  assign default admin
              var admin = new User { UserName = "administrator", Email = "myAdmin@gmail.com" };
              ir = userNamager.Create(admin, "myp@55word");
  
              ir = userNamager.AddToRole(admin.Id, "Admin");
   }
  </code></pre>
  
  <p>where</p>
  
  <pre><code>public class ApplicationDbContext : IdentityDbContext&lt;User&gt;
  {
      public ApplicationDbContext()
          : base("MyDataContext", throwIfV1Schema: false)
      {
      }
      ...
  </code></pre>
  
  <p>The question:  If Add-Migration isn't seeing any change in the model, why do I get this error when I run?  Why isn't the seed code being hit? How do I fix this, or if that can't be determined, how do I further determine the root cause?</p>