Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The term 'Enable-Migrations' is not recognized mvc code first

I'm trying to run for the first time in my new mvc 4 application PM> Enable-Migrations –EnableAutomaticMigrations

I'm geting:

Enable-Migrations : 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 path was included, verify that the path is correct and try again.
At line:1 char:1
+ Enable-Migrations –EnableAutomaticMigrations

What am I missing? I have installed e.f 5.

like image 760
Simon Avatar asked Jun 28 '13 10:06

Simon


People also ask

How do I enable-migrations in Package Manager console?

Open the Package Manager Console from Tools → Library Package Manager → Package Manager Console and then run the enable-migrations command (make sure that the default project is the project where your context class is).

Why add migration is not recognized?

Add-Migration - The Term 'Add-Migration' Is Not Recognized The error occurs sometimes while adding migration in asp.net core, entity framework with code first approach because of some missing library. path is correct and try again.

How can add migration in ASP NET MVC?

Open the Package Manager Console. Select Tools > NuGet Package Manager > Package Manager Console. The Enable-Migration command creates the Migrations folder, which contains a script to initialize the database. Open the Configuration.


2 Answers

Try typing in Package Manager Console:

Install-Package EntityFramework -IncludePrerelease

and then Restart Visual Studio.

like image 143
AmanHanzra Avatar answered Sep 19 '22 04:09

AmanHanzra


First "Install-Package EntityFramework -IncludePrerelease" and then Restarting Visual Studio as a Administrator worked for me together.

[Refer this] : Package Manager Console Enable-Migrations CommandNotFoundException only in a specific VS project

like image 32
Varun Kurumella Avatar answered Sep 19 '22 04:09

Varun Kurumella