Visual Studio Error: (407: Proxy Authentication Re

2019-01-10 07:45发布

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 for the last 2 hours with no success. Every attempt has been met with this error:

enter image description here

The integrated browser works fine when I initiate it. It asks me for my proxy login credentials and once entered, off I go. So there is some different method of connection happening here.

I have also navigated to the TFS server, and once in my project I clicked Open new instance of Visual Studio. The new instance fails with this message in the output:

HTTP code 407: Proxy Authentication Required

I have tried everything that I found on another post to no avail. I have made every edit and combination edits to devev.exe.config that I have found with no success.

Could it be that the 2010 version is somehow different than the 2012 Pro edition? I am running Windows 7.

Can anyone shed some light? Please?

Note: This problem also applies to Visual Studio 2013

12条回答
SAY GOODBYE
2楼-- · 2019-01-10 08:13

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.

    查看更多
    做自己的国王
    3楼-- · 2019-01-10 08:13

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

    查看更多
    放荡不羁爱自由
    4楼-- · 2019-01-10 08:18

    While running Visual Studio 2012 behind a proxy, I received the following error message when checking for extension updates in the Visual Studio Gallery:

    The remote server returned an unexpected response: (417) Expectation failed

    A look around Google finally revealed a solution here:

    Visual Studio 2012 Proxy Settings

    http://www.jlpaonline.com/?p=176

    Basically, he's saying the fix is to edit your devenv.exe.config file and change this:

    <settings>      
       <ipv6 enabled="true"/> 
    </settings>
    

    to this:

     <settings>
       <ipv6 enabled="true"/>      
       <servicePointManager expect100Continue="false"/> 
     </settings> 
    
    查看更多
    淡お忘
    5楼-- · 2019-01-10 08:21

    My case is when using two factor auth, outlook account and VS12.

    I found out I have to

    • open IE (my corporate default browser)
    • log in to visual studio online account (including two factor auth)
    • connect again in VS12 (do the auth again for some reason)
    查看更多
    我只想做你的唯一
    6楼-- · 2019-01-10 08:22

    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

    查看更多
    别忘想泡老子
    7楼-- · 2019-01-10 08:23

    I was trying to connect Visual Studio 2013 to Visual Studio Team Services, and am behind a corporate proxy. I made VS use the default proxy settings (as specified in IE's connection settings) by adding:

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

    to ..\Program Files\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe.config (running notepad as admin and opening the file from within there)

    查看更多
    登录 后发表回答