Package Manager控制台无法正常工作

mar*_*are 40 .net asp.net-mvc nuget asp.net-mvc-3

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

PS E:\myprojectfolder
Run Code Online (Sandbox Code Playgroud)

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

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
Run Code Online (Sandbox Code Playgroud)

有任何想法吗?

Dan*_*eny 34

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

复制自评论:

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

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

这个问题出现在NuGet问题跟踪器上,虽然已关闭(目前)

  • 谢谢.重启VS为我工作.由于加载NuGet模块时出现问题,这似乎是最有效的解决方法. (3认同)
  • 这甚至与VS 2015相关.软件包管理器控制台显示"提供程序失败"并且没有给我提示.只有重启我的电脑才能修好它; 重新启动只是VS没有. (2认同)

小智 30

这个问题的解决方案是:

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