Entity Framework: Add-Migration fails with Unable to update database

后端 未结 4 883
别那么骄傲
别那么骄傲 2021-02-03 11:24

I have been using Entity Framework (5.0) for a while now in a project (ASP.NET MVC in VS2012 Express). Right now, though, I am no longer able to add migrations.

         


        
4条回答
  •  星月不相逢
    2021-02-03 11:56

    In my case I've got the same error because I was forcing ObjectContext.CommandTimeout on class DbContext at constructor method during migration.

    Try removing it

    ((IObjectContextAdapter)this).ObjectContext.CommandTimeout = 5000;
    

提交回复
热议问题