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.
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.