Sandra Andonov
Sandra Andonov

Reputation: 61

The term 'Enable-Migrations' is not recognized as the name of a cmdlet, function, script file, or operable program

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

Upvotes: 6

Views: 15706

Answers (7)

Erik Nordenh&#246;k
Erik Nordenh&#246;k

Reputation: 655

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

Upvotes: 0

sarat
sarat

Reputation: 11110

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

Upvotes: 0

angularsen
angularsen

Reputation: 8668

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

Upvotes: 13

maguy
maguy

Reputation: 1699

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

Upvotes: 1

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

Upvotes: 0

fkerrigan
fkerrigan

Reputation: 300

"Install-Package EntityFramework" will work just as well

Upvotes: -1

AvkashChauhan
AvkashChauhan

Reputation: 20571

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.

Upvotes: 3

Related Questions