【发布时间】:2012-03-20 02:04:24
【问题描述】:
我已经安装了 VS 11 Pro Beta 并打开了我的 MVC4 解决方案,该解决方案首先使用 EF4.3 代码进行迁移。 此解决方案在 VS 2010 下的同一台机器上运行良好:我也可以添加迁移和更新数据库。
但在 VS11 中,我在包管理器控制台中遇到以下错误:
PS D:> 更新数据库
System.Management.Automation.CommandNotFoundException:术语“Get-Project”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确,然后重试。
在 System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode 语句、数组输入、管道输出管道、ArrayList& resultList、ExecutionContext 上下文)
在 System.Management.Automation.StatementListNode.Execute(数组输入、管道 outputPipe、ArrayList& resultList、ExecutionContext 上下文)
在 System.Management.Automation.TryStatementNode.Execute(数组输入、管道 outputPipe、ArrayList 和 resultList、ExecutionContext 上下文)
术语“Get-Project”未被识别为 cmdlet、函数、脚本文件或可运行程序的名称。检查名称的拼写,或者如果包含路径,请验证路径是否正确并重试。
即使在打开控制台后,“包管理器控制台主机版本 1.6.30117.9648”也会打开,但如果基本帮助命令不起作用:
PS D:> 获取帮助 NuGet
Get-Help:找不到主题“NuGet”的帮助。
在 line:1 char:9
+ 获取帮助 + CategoryInfo : ResourceUnavailable: (:) [Get-Help], HelpNotFoundException + FullyQualifiedErrorId : HelpNotFound,Microsoft.PowerShell.Commands.GetHelpCommand
同时我可以使用 NuGet GUI 正常安装包。 请帮助使迁移工作。
【问题讨论】:
-
如果您使用 Entity Framework,您可以查看我在 The term 'Update-Database' is not recognized as the name of a cmdlet 上的回答。