Package Manager控制台无法正常工作

时间:2011-07-31 20:03:28

标签: .net asp.net-mvc asp.net-mvc-3 nuget

根据这个http://docs.nuget.org/docs/start-here/using-the-package-manager-console,我应该看到PM提示符和get-packages之类的命令应该有效。使用我的VS2010,程序包管理器控制台提示符

PS E:\myprojectfolder

并且没有任何命令有效 - 它发出错误说:

PS E:\project>  get-package -ListAvailable
The term 'get-package' 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 co
rrect and try again.
At line:1 char:12
+ get-package <<<<  -ListAvailable
    + CategoryInfo          : ObjectNotFound: (get-package:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

有什么想法吗?

4 个答案:

答案 0 :(得分:34)

不是投票结束并在评论中留下答案,而是将其作为实际答案发布,以便有问题的其他人在搜索结果中看到一个已回答的问题,而不是未答复的问题: - )

从评论中复制:

  

重新启动计算机,VS以某种方式解决了这个问题,关闭

     

是的我之前见过这个问题(没有加载NuGet模块)

     

这个问题出在NuGet issue tracker上,虽然现已关闭(目前)

答案 1 :(得分:30)

这个问题的解决方案是:

  1. 关闭程序包管理器控制台
  2. 关闭项目
  3. 关闭Visual Studio
  4. 启动Visual Studio
  5. 再次打开项目

答案 2 :(得分:0)

我正在使用程序包管理器控制台来安装程序包并收到此错误。奇怪的是,通过使用Nuget Package Manager UI没有生成此错误,问题就解决了。

答案 3 :(得分:0)

解决方案是:

  1. open visual sutido
  2. 打开包管理器控制台
  3. 使用文件菜单打开您的项目
相关问题