Error in downloading WebActivator with NuGet
Asked Answered
S

3

5

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?

Schulte answered 19/11, 2011 at 19:25 Comment(4)
Do you only get that error when installing WebActivator or any package? Are you behind a proxy?Virginiavirginie
I was able to install Ninject before I updated Nuget. After the update, I have been unable to install any package. I am not sure if I am behind a proxy but I can see that I am using a configuration script in IE->Tools->Internet Options->Connetions->Lan Settings. The script starts with http:// and not https and ends with .pac.Schulte
Which version of NuGet exactly? In the Package Manager Console, type $hostDumm
I found a way around. I will mention details separately. But here's what $host gave me: Name : Package Manager Host Version : 1.2.20325.9034 InstanceId : 9336e671-875e-4df9-91e1-a93710c30b16 UI : System.Management.Automation.Internal.Host.InternalHostUserInterface CurrentCulture : en-US CurrentUICulture : en-US PrivateData : NuGetConsole.Host.PowerShellProvider.PowerShellHostProvider+Commander IsRunspacePushed : Runspace :Schulte
S
4

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:

  1. Go to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
  2. Open the devenv.exe.config for editing.
  3. In the System.Net node add the code given below.
  4. Close Visual Studio and reopen it.
  5. Check if the RSS feeds are displaying. If yes, everything else including Nuget should also work.
  6. If RSS feeds section is prompting for password, then provide it and save it.
  7. 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.

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.

Schulte answered 13/12, 2011 at 20:21 Comment(1)
Thanks for this fix! I wasn't able to connect to any online resources until I set the proxy (vs2013 pro). As a point to note for others, when I add an extension via the extensions and updates manager and reset VS, the proxy config gets removed and I am not sure why.Paterson
N
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?.

Nimbus answered 22/9, 2014 at 20:28 Comment(0)
T
0

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:

  1. Going into NuGet settings and adding a new package source pointing to http://nuget.org/api/v2/ (no s in the scheme)
  2. Disabled the default source
  3. Enabled my newly added source

Now, I don't get the error message anymore. Et voilà!

Therapsid answered 15/10, 2012 at 9:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.