Enable Migration error - object refreence, MigrationsDomainCommand

ef-migrations entity-framework

Question

I have a MVC 4 project and recently upgraded to EF 6.0. I have only one project which contains the models and dbcontext. I was unable to enable migrations, the errors are as follows:

System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName) at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory) at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName) at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Object reference not set to an instance of an object.

Googling for an answer for past 2 days, nothing seems to work. Please help me.

1
6
7/14/2017 2:20:28 AM

Popular Answer

I had the same issues this week when my senior developer updated the solution to EF6.

After a 'Get latest' from source control, the migrations weren't working anymore. A Visual Studio restart solved that problem. Probably the EF5 libraries were still in memory.

9
3/12/2014 10:14:37 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow