.net 包管理器控制台不工作
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6891966/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Package Manager console not working
提问by mare
According to this http://docs.nuget.org/docs/start-here/using-the-package-manager-consoleI should see the PM prompt and commands like get-packagesshould work. With my VS2010 the Package Manager Console prompt says
根据这个http://docs.nuget.org/docs/start-here/using-the-package-manager-console我应该看到 PM 提示和类似的命令get-packages应该可以工作。在我的 VS2010 中,包管理器控制台提示说
PS E:\myprojectfolder
and none of the commands work - it issues an error saying:
并且所有命令都不起作用 - 它发出一条错误消息:
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
Any ideas?
有任何想法吗?
采纳答案by Danny Tuppeny
Rather than voting to close and leaving the answer in comments, it's worth posting it as an actual answer so that others with the problem see an answered question in search results, rather than an unanswered one :-)
与其投票关闭并将答案留在评论中,不如将其作为实际答案发布,以便其他有问题的人在搜索结果中看到已回答的问题,而不是未回答的问题 :-)
Copied from the comments:
复制自评论:
restarting the computer and VS somehow fixed this issue, closing
Yes I've seen this issue before (where the NuGet module isn't loaded)
This issue is on the NuGet issue tracker, though it's closed (at the moment)
重新启动计算机和 VS 以某种方式修复了这个问题,关闭
是的,我以前见过这个问题(未加载 NuGet 模块)
此问题在NuGet 问题跟踪器上,尽管它已关闭(目前)
回答by sacredseer
The solution to this problem would be:
这个问题的解决方案是:
- Close the Package Manager Console
- Close the Project
- Close Visual Studio
- Start Visual Studio
- Open the project again
- 关闭包管理器控制台
- 关闭项目
- 关闭 Visual Studio
- 启动 Visual Studio
- 再次打开项目
回答by Arvand
I was using Package Manager Console for installing a package and was getting this error. Strangely by using the Nuget Package Manager UI did not generate this error and the problem was solved.
我正在使用包管理器控制台安装包并收到此错误。奇怪的是,通过使用 Nuget 包管理器 UI 并没有产生这个错误,问题解决了。
回答by Blue Joy
the solution is:
解决办法是:
- open visual sutido
- open the package manager console
- use the file menu open your project
- 打开视觉sutido
- 打开包管理器控制台
- 使用文件菜单打开你的项目

