Package manager in Visual Studio 2015 “407 (Proxy Authentication Required)”

后端 未结 8 2030
孤街浪徒
孤街浪徒 2020-12-17 20:08

I understand this is an often asked question, however after days of research I\'ve not found an answer to this particular problem.


I have a new ASP.NE

相关标签:
8条回答
  • 2020-12-17 20:27

    If you have Fiddler installed, tick the option 'Automatically Authenticate' under the Rules option, should fix the above issue.

    Selecting the Automatically Authenticate

    Got this from the following post Configuring Fiddler to use company network's proxy?

    0 讨论(0)
  • 2020-12-17 20:31

    If you don't know the proxy server details, you can go with other workaround to overcome this error "407 (Proxy Authorisation Required.)"

    Workaround: 1. Download/Install Fiddler 2. Click Menu Rules -> Automatically Authenticate

    Without closing Fiddler, now try to do restore package in Visual Studio. It should now restore the packages without any proxy error.

    This is not a neat solution, but still an alternate workaround to resolve this issue. This solution tries to utilise Fiddler as Proxy.

    0 讨论(0)
  • 2020-12-17 20:34

    I had to modify the 32 bit machine.config (assumption being VS runs in 32 bit) to add the <system.net> section but omitting anything within the <defaultProxy> tag:

    <system.net>
        <defaultProxy useDefaultCredentials="True" enabled="True" />
    </system.net>
    

    According to MSDN:

    If the defaultProxy element is empty, the proxy settings from Internet Explorer will be used.

    This is perfect for me as every other application on my machine works - including IE.

    manchine.config location (Win 7): %SYSTEMROOT%\Microsoft.NET\Framework\v4.0.30319\Config\machine.config


    Note

    I resolved this thanks to @user3063127 pointing me in the right direction (you have an upvote). As far as I can tell this only affects package restore on DNX projects and may well be fixed when RC2 is released.

    0 讨论(0)
  • 2020-12-17 20:45

    Maybe you have wrong proxy credentials in Credential Manager. Try to remove it.

    Control Panel -> User Account -> Credential Manager.

    Remove proxy credentials resolved my problem.

    0 讨论(0)
  • 2020-12-17 20:46

    Adding proxy username, password fixed my 407 authentication issue.

    Place the following snippet in NuGet.config file located at C:\Users\myUserName\AppData\Roaming

    <configuration>
    
       <config>
         <add key="http_proxy" value="http://my.proxy.address:port" />
         <add key="http_proxy.user" value="mydomain\myUserName" />
         <add key="http_proxy.password" value="[base64 encoded Password]" />
       </config>
    
    </configuration>
    

    Ref: https://forums.asp.net/t/2096179.aspx?Proxy+407+Access+Denied

    0 讨论(0)
  • 2020-12-17 20:48
    1. Updated to latest nuget.exe 1st

      nuget update self
      
    2. Added proxy details to the config file:

      nuget config -Set http_proxy=http://username:password@proxyserver.company.com:port
      
    0 讨论(0)
提交回复
热议问题