13

我第一次尝试在我的新 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

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

4

4 回答 4

14

尝试在包管理器控制台中输入:

Install-Package EntityFramework -IncludePrerelease

然后重新启动 Visual Studio。

于 2014-04-18T13:07:42.170 回答
1

首先“Install-Package EntityFramework -IncludePrerelease”,然后以管理员身份重新启动 Visual Studio 一起为我工作。

[参考此]: 包管理器控制台 Enable-Migrations CommandNotFoundException 仅在特定的 VS 项目中

于 2015-08-04T12:30:07.387 回答
0

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

于 2014-03-20T09:17:50.873 回答
0

您必须确保项目的路径目录中没有任何方括号“[”。显然 VS 2013 对用方括号命名的项目文件夹不满意。

于 2016-05-18T13:50:26.750 回答