6

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

1
  • If it helps someone: I was suppose to install EF 4.3 so i can enable migrations. Commented Jun 26, 2012 at 7:46

7 Answers 7

13

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

Sign up to request clarification or add additional context in comments.

Comments

3

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.

Comments

1

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

Comments

0

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

Comments

0

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

Comments

0

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

Comments

-1

"Install-Package EntityFramework" will work just as well

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.