问题
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
How can I go about this?
回答1:
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:
- Go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
- Open the devenv.exe.config for editing.
- In the System.Net node add the code given below.
- Close Visual Studio and reopen it.
- Check if the RSS feeds are displaying. If yes, everything else including Nuget should also work.
- If RSS feeds section is prompting for password, then provide it and save it.
- If things don't work still, run fiddler and go through steps 4 to 6 again. (Just running Fiddler in background also helps in some cases. See link below.)
Code to put in devenv.exe.config:
<defaultProxy useDefaultCredentials="true" enabled="true">
<proxy proxyaddress="http://ProxyServer:8080"/>
</defaultProxy>
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
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.
回答2:
As a backup if your proxy is HTTPS only, you can follow the package download instructions from: Nuget packages without nuget package manager? and then the installation instructions from: How to install a Nuget Package .nupkg file locally?.
回答3:
I'm not behind a corporate proxy, so the error message made absolutely no sense to me. What helped, though, was to replace the default NuGet package source. I did this by:
- Going into NuGet settings and adding a new package source pointing to
http://nuget.org/api/v2/
(nos
in the scheme) - Disabled the default source
- Enabled my newly added source
Now, I don't get the error message anymore. Et voilà!
来源:https://stackoverflow.com/questions/8196629/error-in-downloading-webactivator-with-nuget