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条回答
ら.Afraid
2楼-- · 2019-01-10 07:57

After three days of searching, the solution fell into my lap.

Now, what happened was VS tried to do an automatic update but was stopped by the proxy. I was prompted for credentials and the check took place.

I was inspired to check the TFS server connection just for kicks in case that prompt would possibly establish a connection for the TFS server to tunnel through... lo and behold! It worked!

WORKAROUND:

  1. Open TOOLS>Extensions & Updates
  2. Click on Updates... in the left-hand menu
  3. There will be a failure notice on screen and a link to enter your credentials. Click it and enter them.
  4. Close the Extension manager.
  5. Click TEAM>Connect to TFS server...
  6. Enter the address and it will work!

Note: Some have suggested trying to use the proxy credential prompt by opening the integrated browser but this has not worked. I am not an expert but I think they are connecting through different channels within windows itself.

There is no editing of devenv.exe.config required for this to work.

It will be a pain to have to check for updates manually every time you need to connect to the server, but this is the best solution I have come up with until Microsoft fixes this issue permanently with an update or future release.

查看更多
爷的心禁止访问
3楼-- · 2019-01-10 07:57

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

查看更多
▲ chillily
4楼-- · 2019-01-10 08:00

Download and install Fiddler

Open Fiddler and go to Rule menu to tick Automatically authenticate

Now open visual studio and click on sign-in button.

Enter your email and password.

Hopefully it will work

查看更多
混吃等死
5楼-- · 2019-01-10 08:02

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.

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

I faced the same error with my Visual Studio Team Services account (formerly Visual Studio Online, Team Foundation Service).

I simply entered the credentials using the VS 2013 "Connect to Team Foundation Server" Window, and then connected it to the Visual Studio Team Services Team Project. It worked this way.

查看更多
你好瞎i
7楼-- · 2019-01-10 08:07

Using IDE configuration:

  1. Open Visual Studio 2012, click on Tools from the file menu bar and then click Options,

  2. From the Options window, expand the Source Control option, click on Plug-in Selection and make sure that the Current source control plug-in is set to Visual Studio Team Foundation Server.

  3. Next, click on the Visual Studio Team Foundation Server option under Source Control and perform the following steps: Check Use proxy server for file downloads. Enter the host name of your preferred Team Foundation Server 2010 Proxy server. Set the port to 443. Check Use SSL encryption (https) to connect.

  4. Click the OK button.

Using exe.config:

Modify the devenv.exe.config where IDE executable is like this:

<system.net> 
  <defaultProxy>  
   <proxy proxyaddress=”http://proxy:3128”
     bypassonlocal=”True” autoDetect=”True” /> 
   <bypasslist> 
   <add address=”http://URL”/>  
  </bypasslist> 
 </defaultProxy> 

Declare your proxy at proxyaddress and remember bypasslist urls and ip addresses will be excluded from proxy traffic.

Then restart visual studio to update changes.

查看更多
登录 后发表回答