相关疑难解决方法(0)

程序包管理器控制台仅在特定的VS项目中启用 - 迁移CommandNotFoundException

我试图在一个新项目中运行命令'Enable-Migrations',我收到了消息:

PM> 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, verif
y that the path is correct and try again.
At line:1 char:18
+ Enable-Migrations <<<< 
    + CategoryInfo          : ObjectNotFound: (Enable-Migrations:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)

但是在所有其他项目中,命令运行得很好.

为什么会这样?

顺便说一下,我正在使用VS2010 Professional SP1

编辑:我重新安装了命令:Install-Package EntityFramework -IncludePrerelease ,问题消失了.

migration entity-framework

108
推荐指数
8
解决办法
11万
查看次数

术语"启用 - 迁移"不会被识别为cmdlet,函数,脚本文件或可运行程序的名称

当我输入此命令时:程序包管理器控制台中的"启用 - 迁移"我收到此错误:

"术语'启用 - 迁移'不会被识别为cmdlet,函数,脚本文件或可操作程序的名称.请检查名称的拼写,或者如果包含ap ath,请验证路径是否正确,然后重试.行:1字符:18 +启用 - 迁移<<<< + CategoryInfo:ObjectNotFound :(启用 - 迁移:字符串)[],CommandNotFoundException + FullyQualifiedErrorId:CommandNotFoundException"

我正在使用带有EF 4.0的VS2010,我只是在使用windows azure部署网站时做了非常简单的测试项目,但出于某种原因我无法启用迁移.

任何人有任何想法?谢谢

azure ef-migrations

6
推荐指数
2
解决办法
1万
查看次数