The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 2,343 other followers

Connecting Visual Studio 2010 to TFS over a Corporate Proxy (via: Visual studio 2010: cannot connect for any online resource – Stack Overflow)

Posted by jpluimers on 2012/07/11

One of the clients has tightened up their web proxy so much that Visual Studio 2010 does not want to connect to the HTTP 8080 port on the external TFS server (yes, I will switch to HTTPS if the workaround appears stable enough).

The problem is that Visual Studio often just tells you it cannot connect. No further error details.

Well, after you get most things working, you get this error every now and then:

[Microsoft Visual Studio]
Error
Team Foundation services are not available from server tfs.some-domain\PREFIX.
Technical information (for administrator):
HTTP code 407: Proxy Authentication Required
[OK]

There are a few problems involved:

  • Visual Studio does not allow you to enter credentials for the Proxy server.
  • Visual Studio doesn’t fully use the proxy settings from Internet Explorer either.
  • Visual Studio (unlike Internet Explorer) seems to loose the proxy session and or proxy authentication for that session over time.

All in all, it is fishy, even editing the devenv.exe.config proxy settings didn’t work (maybe I haven’t found the right combination of settings yet: that’s part of the research I need to do).

Workaround

So far, these are the current workaround steps (I will post a new entry when I found the solution or shortened the steps).

The workaround includes HTTP Fiddler, and sometimes doesn’t work without. HTTP Fiddler helps anyway as it shows the HTTP traffic (including error messages from the proxy server) between Visual Studio and TFS.

Once:

  1. Start Visual Studio
  2. Go to the start page
  3. Click on “Connect To Team Foundation Server
  4. Click on the Servers button
  5. Click on the Add button
  6. Enter your TFS server FQDN
  7. Save the TFS URL in a handy place
    (the TFS URL looks like this: http://servername:8080/tfs)
  8. Copy the TFS URL from the “preview” textbox
  9. Cancel out of all the dialogs, then quit Visual Studio
  10. Start Internet Explorer
  11. Enter copied URL in the address bar, and press Enter
  12. Enter your HTTP proxy credentials and save them
  13. Enter your TFS credentials and save them
  14. Close Internet Explorer
  15. Download and install HTTP Fiddler
  16. Start HTTP Fiddler
  17. Start Internet Explorer
  18. Enter copied URL in the address bar, and press Enter
  19. Enter your HTTP proxy credentials
  20. Enter your credentials and save them

Now you have saved your TFS credentials both for going directly through the main proxy and having Fiddler inbetween you and the main proxy.

Once to get the basics of TFS connected in Visual Studio:

  1. Run HTTP Fiddler
    (this is a second proxy, it at least allows you to see the underlying HTTP traffic, and gives more context to any – or none – messages that Visual Studio gives you).
  2. Run Visual Studio 2010
  3. Go to the start page
  4. Click on “What’s New in Visual Studio 2010” (or any of the other hyperlinks on the external page)
  5. Enter your HTTP proxy credentials and save them
  6. Go to the start page
  7. Click on “Connect To Team Foundation Server
  8. Click on the Servers button
  9. Click on the Add button
  10. Enter your TFS server FQDN
  11. Click on the OK button
    (now you should not get an error message any more)
  12. Click on the Close button
  13. Select your TFS server
  14. Select the team projects you want
  15. Click on the Connect button
    (now the Team Explorer pane gets the focus)
  16. Double click on the “Source Control” tree node

Every time you start Visual Studio:

  1. Run HTTP Fiddler
    (this is a second proxy, it at least allows you to see the underlying HTTP traffic, and gives more context to any – or none – messages that Visual Studio gives you).
  2. Run Visual Studio 2010
  3. Go to the start page
  4. Click on “What’s New in Visual Studio 2010” (or any of the other hyperlinks on the external page)
  5. When needed: Enter your HTTP proxy credentials and save them
  6. Go to the start page
  7. Click on “Connect To Team Foundation Server
  8. Click on the Servers button
  9. Click on the Add button
  10. Enter your TFS server FQDN
  11. Click on the OK button
    (now you should not get an error message any more)
  12. Click on the Close button
  13. Select your TFS server
  14. Select the team projects you want
  15. Click on the Connect button
    (now the Team Explorer pane gets the focus)
  16. Double click on the “Source Control” tree node

Every time you get a TFS related error, or TFS seems to not respond:

  1. Check in HTTP Fiddler if it is a 407 error, when not so: restart Visual StudioWhen so:
  2. Close the start page in Visual Studio 2010
  3. Open the start page in Visual Studio 2010
  4. Click on “What’s New in Visual Studio 2010” (or any of the other hyperlinks on the external page)
  5. Enter your HTTP proxy credentials
  6. Enter your TFS credentials
  7. Retry your TFS action
  8. If that fails, do the above steps, but first close your window that involves the TFS Action
  9. If 8 fails, restart Visual Studio

Error messages

Over time I’ll try to list the errors I have seen in this post.

This is an error you can get upon starting Visual Studio is this:

[Microsoft Visual Studio]
TF205020: A connection could not be made to the following server: tfs.somedomain\PREFIX. This server was used during your most recent session, but it might be offline, or network problems might be preventing the connection. Contact the administrator for Team Foundation Server to confirm that the server is available on the network. To attempt to connect to this server or a different server, open the Team menu, and click Connect to Team Foundation Server.
--
The server returned the following error: Team Foundation services are not available from server tfs.somedomain\PREFIX.
Technical information (for administrator):
HTTP code 407: Proxy Authentication Required
[OK]

–jeroen

via:

3 Responses to “Connecting Visual Studio 2010 to TFS over a Corporate Proxy (via: Visual studio 2010: cannot connect for any online resource – Stack Overflow)”

  1. […] Many other applications had issues (for instance Visual Studio connecting to Team Foundation System was very unreliable and the workarounds clumsy). […]

  2. […] One of the things you cannot to is start RegEdit, not even for viewing. Since I need Fiddler2 to poke through their Internet Proxy in order to get access to an external TFS server, and their machines often reboot due to maintenance cycles, sometimes my proxy settings are dead. […]

  3. […] while ago, I wrote on Connecting Visual Studio 2010 to TFS over a Corporate Proxy and all the trouble that […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

 
%d bloggers like this: