【发布时间】:2012-05-11 19:06:46
【问题描述】:
我尝试在一个新项目中运行命令“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
但在所有其他项目中,该命令运行良好。
为什么会这样?
顺便说一句,我使用的是 VS2010 Professional SP1
编辑:我使用命令重新安装:Install-Package EntityFramework -IncludePrerelease 问题就解决了。
【问题讨论】:
-
您好,请将您的解决方案添加为答案并将其标记为已接受(您可以在 2 天后执行此操作),这样它就不会显示为未回答的问题。
-
我遇到了同样的问题。但是这个线程中的所有东西似乎都不起作用。您是重新安装了整个 Visual Studio 还是只是运行了该命令?
-
我只是简单地运行了命令...
-
遗憾的是,该命令的结果对我来说只是“'EntityFramework 6.1.0'已经安装。”它仍然没有 add-migration 或 enable-migrations 作为有效命令。
-
我正在安装包:无法找到包 'EntityFramework'。当我尝试你的解决方案时
标签: entity-framework migration