首先不识别mvc代码中的"启用 - 迁移"一词

Sim*_*mon 13 ef-code-first asp.net-mvc-4

我正在尝试在我的新mvc 4应用程序PM> Enable-Migrations -EnableAutomaticMigrations中第一次运行

我在说:

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
Run Code Online (Sandbox Code Playgroud)

我错过了什么?我已经安装了ef 5.

小智 14

尝试在Package Manager控制台中输入:

Install-Package EntityFramework -IncludePrerelease
Run Code Online (Sandbox Code Playgroud)

然后重新启动Visual Studio.

  • 重新启动做了惊慌! (3认同)

sar*_*rat 0

我安装了框架(5.x),并在管理模式下运行后重试运行相同的命令。这已经解决了问题——尽管很奇怪。