Entity Framework 4.3 migrations error

Solution found. It turns out, that you need to enable migrations for your project. You can do this by running Enable-Migrations in the NuGet console (make sure you have the right project selected - for me this was the project.domain project).

This walkthrough provides more information


Sometimes, even if you have enabled migration, this problem can occur. It means that configuration file has been deleted. In this case, you can run

Enable-Migrations -Force 

in the Package Manager Console. -Force parameter is to override migration configuration file.


If you had already enabled migrations and just started seeing this error after some windows updates, ensure you are using the same version of Entity Framework across all projects using the NuGet Package Manager.

Recent windows updates may have installed a newer version of Entity Framework into your active project.

Background: Around 16 Mar 2016, I started getting the "no migrations configuration type" error when trying to add migrations to a project where I had already enabled migrations and had successfully done migrations before.

I noticed that around March 10, a new stable version of Entity Framework 6 had been released.

If I specified the -ContextTypeName parameter in the enable-migrations command, I got an error indicating the migrations were already enabled.

Another error I got as I was troubleshooting indicated that the Configuration type was not inheriting from the System.Data.Entity.ModelConfiguration.EntityTypeConfiguration, even though it was.

That led me to believe different versions of the Entity Framework were conflicting.

Resolution:

1) Tools -> Nuget Package Manager -> Manage Nuget Packages for Solution

2) (Not sure if this step is necessary, but..) I updated my version of the Nuget Package Manager to the latest version. Also, after updating my version of Nuget Package Manager, I had to restart Visual Studio twice before the NuGet Command line would work properly.

3) Tools -> Nuget package Manager -> Manage Nuget Packages for Solution -> Search Installed packages -> Type Entity Framework

a. You may see more than one version of Entity Framework there.

b. Click Manage on each version of Entity Framework and ensure that your projects are using the SAME version of Entity Framework. •Uncheck the version of Entity Framework that you are not using and for the version of Entity Framework you ARE using make sure it is checked across your projects that need it.

Again, as noted in step 2, I had to restart visual studio twice to get the NuGet Package Manager Console to work properly after updating my version of the NuGet Package Manager. I got an error starting the console the first time, and "exception calling createinstancefrom with 8 arguments could not load file or assembly EntityFramework" when running the enable-migrations command the second time.

Restarting visual studio seemed to resolve those issues, however.