Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error in downloading WebActivator with NuGet

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?

like image 405
Yasir Avatar asked Nov 19 '11 19:11

Yasir


People also ask

How do I fix a NuGet package error?

Quick solution for Visual Studio usersSelect the Tools > NuGet Package Manager > Package Manager Settings menu command. Set both options under Package Restore. Select OK. Build your project again.

How do I manually download a NuGet package?

Using manual download to acquire a package To download manually, click on Download the raw nupkg file. A copy of the package is copied to the download folder for your browser with the name <name>. <version>. nupkg .

How do I force a NuGet package to install?

Switch to the Browse tab, search for the package name, select it, then select Install). For all packages, delete the package folder, then run nuget install . For a single package, delete the package folder and use nuget install <id> to reinstall the same one.

How do I allow NuGet to download missing packages?

To do that, go to Tools, NuGet Packaged Manager, then go to Package Manager Settings. Go to the General section, and then make sure you have a checkmark for Allow NuGet to download missing packages and also to automatically check for missing packages during the build in Visual Studio. So click on OK.


1 Answers

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.

  • 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.

like image 50
Yasir Avatar answered Dec 02 '22 06:12

Yasir