6
votes

When I enter this command: 'Enable-Migrations' in Package Manager Console I get this error:

"The term 'Enable-Migrations' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a p ath was included, verify that the path is correct and try again. At line:1 char:18 + Enable-Migrations <<<< + CategoryInfo : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException"

I am using VS2010 with EF 4.0 and I was just doing really simple test project for deploying web site with windows azure,but for some reason I can not enable migrations.

Anyone has any idea? Thanks

7
If it helps someone: I was suppose to install EF 4.3 so i can enable migrations.Sandra Andonov

7 Answers

13
votes

Try to restart Visual Studio. It helped in my case.

3
votes

First thing you need VS2010 Professional SP1.

After that please reinstall application package with commmand Install-Package EntityFramework -IncludePrerelease and it should solve your problem.

1
votes

If you have the latest EntityFramework and the 'Enable-Migrations' command is still showing the error reinstall/upgrade NuGet, see documentation: http://docs.nuget.org/docs/start-here/installing-nuget

0
votes

Make sure you have a solution opened. I got this error because I tried to run it without any solution opened. When I opened a solution it worked fine

0
votes

I was working on existing code-base which already had Entity Framework 5.x was installed. Some of the solutions suggested to upgrade to latest version and run but, installing the newest version remove System.Data.Entity. Adding the reference again caused errors in my old code which was using deprecated APIs.

The solution is run as administrator if you've already installed the framework in your solution

0
votes

I had this exact problem and was using an old version of NuGet, what worked for me was updating NuGet via the extensions interface.

-1
votes

"Install-Package EntityFramework" will work just as well