使用NuGet下载WebActivator时出错 [英] Error in downloading WebActivator with NuGet
问题描述
我刚刚在公司计算机上更新了NuGet软件包管理器.自更新以来,我无法添加任何软件包.我尝试例如安装WebActivator并收到以下错误:
I just updated my NuGet Package Manager on my corporate machine. Ever since the update, I am unable to add any package. I tried to install WebActivator for instance and got the following error:
PM> Install-Package WebActivator
Install-Package : The ServicePointManager does not support proxies with the https scheme.
At line:1 char:16
+ Install-Package <<<< WebActivator
+ CategoryInfo : NotSpecified: (:) [Install-Package], NotSupportedException
+ FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand
我该怎么办?
推荐答案
以下解决方法对我有所帮助.请注意,我使用的是Windows 7,Visual Studio 2010 Professional,IE 9,并且位于公司代理之后.您的步骤可能会因环境而异:
The following work around helped me. Note that I am using Windows 7, Visual Studio 2010 Professional, IE 9 and am behind a corporate proxy. Your steps might vary depending on your environment:
- 转到C:\ Program Files(x86)\ Microsoft Visual Studio 10.0 \ Common7 \ IDE
- 打开devenv.exe.config进行编辑.
- 在System.Net节点中,添加下面给出的代码.
- 关闭Visual Studio并重新打开它.
- 检查RSS源是否正在显示.如果是的话,包括Nuget在内的所有其他东西也都应该起作用.
- 如果"RSS提要"部分提示输入密码,请提供并保存.
- 如果仍然无法正常运行,请运行提琴手,然后再次执行步骤4至6. (在某些情况下,仅在后台运行Fiddler也会有所帮助.请参见下面的链接.)
放入devenv.exe.config的代码:
Code to put in devenv.exe.config:
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://ProxyServer:8080"/>
</defaultProxy>
基于以下两个讨论,这确实是一个hack,但它可以正常工作.
This is really a hack based upon the following two discussions, but it works.
- Cannot connect to any online resource
- http://nuget.codeplex.com/discussions/242477
希望这可以帮助遇到类似问题的其他人.但我真的希望有更好的方法.对代理服务器和端口进行硬编码似乎不是一个非常可维护的解决方案.另外,应该有使用WebActivator和Nuget.MVC3之类的NuGet包的替代方法.
Hope this helps others who have similar issues. But I really wish there is a better way around. Hardcoding the proxy server and port doesn't seem to be a very maintainable solution. Also, there should be an alternative way of using NuGet packages like WebActivator and Nuget.MVC3.
这篇关于使用NuGet下载WebActivator时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!