Visual Studio Error: (407: Proxy Authentication Required)

前端 未结 13 1607
攒了一身酷
攒了一身酷 2020-12-02 09:28

I am behind a corporate proxy server which requires credentials. I have been trying to connect to a TFS server (on tfspreview.com) with MS Visual Studio Pro 2012

相关标签:
13条回答
  • 2020-12-02 09:55

    The situation is essentially that VS is not set up to go through a proxy to get to the resources it's trying to get to (when using FTP). This is the cause of the 407 error you're getting. I did some research on this and there are a few things that you can try to get this debugged. Fundamentally this is a bit of a flawed area in the product that is supposed to be reviewed in a later release.

    Here are some solutions, in order of less complex to more complex:

  • If possible don't use the proxy for the specified domains that you're trying to get to.
  • Set up your proxy settings correctly Internet Explorer (even if you don't use it) as that affects system wide settings. Even go so far as to connect to the internet with internet explorer and leave it connected then go back and try again from VS.
  • In the devenv.exe.config add <servicePointManager expect100Continue="false" /> as laid out below:
  • <configuration>
      <system.net>
        <settings>
          <servicePointManager expect100Continue="false" />
        </settings>
      </system.net>
    </configuration>
    

  • Add defaultProxy settings as follows:
  • <system.net>
      <defaultProxy useDefaultCredentials="true" enabled="true">
          <proxy proxyaddress="http://your.proxyserver.ip:port"/>
      </defaultProxy>
      <settings>
      ...
    

  • Alternately you could try telling it to use system default (which should pull from internet explorer) like so:

    <defaultProxy useDefaultCredentials="true" enabled="true">
        <proxy usesystemdefault="True" />
    </defaultProxy>
    

  • There is an older solution involving creating a plugin here
  • Hope this solves it for you.

0 讨论(0)
  • 2020-12-02 09:58

    This helped in my case :

    1. close VS instance
    2. open Control Panel\User Accounts\Credential Manager
    3. Remove TFS related credentials from vault

    This is just a hack. You need to do it regulary ... :-(

    Best regards,

    Alexander

    0 讨论(0)
  • 2020-12-02 09:58

    I was getting an "authenticationrequired" (407) error when clicking the [Sync] button (using the MS Git Provider), and this worked for me (VS 2013):

    ..\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config

      <system.net>
        <defaultProxy useDefaultCredentials="true" enabled="true">
          <proxy proxyaddress="http://username:password@proxyip:port" />
        </defaultProxy>
        <settings>
          <ipv6 enabled="false"/>
          <servicePointManager expect100Continue="false"/>
        </settings>
      </system.net>
    

    I think the magic for me was setting 'ipv6' to 'false' - not sure why (perhaps only IPv4 is supported in my case). I tried other ways as shown above, but I move the "settings" section AFTER "defaultProxy", and changed "ipv6", and it worked perfectly with my login added (every other way I tried in all other answers posted just failed for me).

    Edit: Just found another work around (without changing the config file). For some reason, if I disable the windows proxy (it's a URL to a PAC file in my case), try again (it will fail), and re-enable the proxy, it works. Seems to cache something internally that gets reset when I do this (at least in my case).

    0 讨论(0)
  • 2020-12-02 09:59

    I was having the same problem, and none of the posted solutions worked. For me the solution was:

    • Open Internet Explorer > Tools > Internet Options
    • Click Connections > LAN settings
    • Untick 'automatically detect settings' and 'use automatic configuration script'

    This prevented the proxy being used, and I could then authenticate without problem.

    0 讨论(0)
  • 2020-12-02 10:02

    The solution that worked for me in both Visual Studio 2013 and Microsoft Test Manager (MTM) was to ensure that both devenv.exe.config and mtm.exe.config included this configurations section:

    <system.net>
        <settings>
            <ipv6 enabled="true"/>
            <servicePointManager expect100Continue="false"/>
        </settings>
        <defaultProxy useDefaultCredentials="true" enabled="true">
            <proxy usesystemdefault="True" />
        </defaultProxy>
    </system.net>
    

    MTM did not have a system.net setting and the whole section was added immediately following the closing xml tag </appSettings>.

    0 讨论(0)
  • 2020-12-02 10:03

    I got this error when running dotnet publish while connected to the company VPN. Once I disconnected from the VPN, it worked.

    0 讨论(0)
  • 提交回复
    热议问题