0

I manually changed the database and the models to match, but I'm getting this error. How do I change ASP.NET Identity to not try to run database migrations?

The model backing the 'ApplicationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).

[InvalidOperationException: The model backing the 'ApplicationDbContext' context has changed since the database was created. Consider using Code First Migrations to update the database (http://go.microsoft.com/fwlink/?LinkId=238269).]
System.Data.Entity.CreateDatabaseIfNotExists`1.InitializeDatabase(TContext context) +262
System.Data.Entity.Internal.<>c__DisplayClassf`1.b__e() +165 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) +110
System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() +660 System.Data.Entity.Internal.LazyInternalContext.b__4(InternalContext c) +31
System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) +143 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) +292
System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() +123 System.Data.Entity.Internal.InternalContext.Initialize() +42 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) +39
System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() +137
System.Data.Entity.Internal.Linq.InternalSet`1.Include(String path) +41 System.Data.Entity.Infrastructure.DbQuery`1.Include(String path) +142
System.Data.Entity.QueryableExtensions.Include(IQueryable`1 source, String path) +205
System.Data.Entity.QueryableExtensions.Include(IQueryable`1 source, Expression`1 path) +305
Microsoft.AspNet.Identity.EntityFramework.UserStore`6.GetUserAggregateAsync(Expression`1 filter) +610
Microsoft.AspNet.Identity.EntityFramework.UserStore`6.FindByNameAsync(String userName) +1071
Microsoft.AspNet.Identity.UserManager`2.FindByNameAsync(String userName) +177
Microsoft.AspNet.Identity.d__4.MoveNext() +803
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter.GetResult() +21 Microsoft.AspNet.Identity.d__0.MoveNext() +468 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24 Microsoft.AspNet.Identity.CultureAwaiter`1.GetResult() +123 Microsoft.AspNet.Identity.d__0.MoveNext() +795
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93
System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) +52 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() +24 Microsoft.AspNet.Identity.CultureAwaiter`1.GetResult() +123 Microsoft.AspNet.Identity.d__d.MoveNext() +970
System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) +93

Andrew Whitaker
  • 124,656
  • 32
  • 289
  • 307
Jonathan Allen
  • 68,373
  • 70
  • 259
  • 447
  • the model shouldn't use that interface anymore CreateDatabaseIfNotExists - do you have an initializer using this? maybe in global? – Nikki9696 Jun 19 '15 at 19:14
  • 1
    Or maybe this is the issue http://stackoverflow.com/questions/14654055/how-can-i-disable-code-first-migrations – Nikki9696 Jun 19 '15 at 19:21
  • @Nikki9696 Yep, that's the answer. But I'm marking it as a duplicate of another question that is a little more clear. – Jonathan Allen Jun 19 '15 at 19:22

0 Answers0