I am using Entity Framework 5.0 Data migrations along with code first. When i add a new field to my model and execute the following command in the package manager console.>
I had a problem similar to this, where using the -force
flag on add-migration
to re-scaffold an existing migration stopped working for no apparent reason.
No matter what I did I got the stupid "Unable to generate an explicit migration because the following explicit migrations are pending" error message. After trying nearly everything I could think of and stopping just short of smashing my laptop to pieces, out of desperation I ran enable-migrations
again and of course got the "Migrations have already been enabled in project 'Blah.Blah'" message. Tried add-migration -force
again and magically it was working.
I have no idea what it changed- must have been some user settings/config file outside of source control. Hopefully this will help someone else.