Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Accessing Nuget Official Package Source behind company proxy

I am trying to use Nuget in VS2010 at work. When I try and download packages from the official feed it always fails with a 403.

I've read that Nuget will use the same proxy settings as IE, which is unfortunate for me as my IE is locked down. I can't change the proxy.

I have fiddled the feedservice urls that are getting bounced, in IE I get an error, in Firefox (with a local proxy.pac defined) the urls resolve fine and I can see the feeds.

Is there any way to manually configure Nuget not to use IE's settings?

like image 844
Mike Simmons Avatar asked Oct 10 '11 09:10

Mike Simmons


People also ask

Where are NuGet package sources stored?

The default is %userprofile%\. nuget\packages (Windows) or ~/. nuget/packages (Mac/Linux). A relative path can be used in project-specific nuget.

Are NuGet packages open source?

NuGet's client, nuget.exe is a free and open-source, command-line app that can both create and consume packages.

What is the NuGet package source URL?

The location of the service index for nuget.org is https://api.nuget.org/v3/index.json .


1 Answers

If you can't get the exception added to your proxy, or just want an immediate solution then edit your Visual studio configuration file (devenv.exe.config) located in your Visual Studio installation directory (eg - C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE) and change/add the <system.net> configuration section to the following, which will let Visual Studio work with the proxy:

<system.net>
    <defaultProxy useDefaultCredentials="true" enabled="true">
        <proxy proxyaddress="http://<Insert proxy address here>" />
    </defaultProxy>
    <settings>
        <servicePointManager expect100Continue="false" />
        <ipv6 enabled="true" />
    </settings>
</system.net>

All you need to do is change the <Insert proxy address here> to your company's proxy address. Also depending on your proxy settings you may be able to use Expect100Continue messages and may not need to change that configuration element. You can find more information here

like image 200
Xcalibur Avatar answered Dec 01 '22 18:12

Xcalibur