Quantcast
Channel: Visual Studio and tools – The Wiert Corner – irregular stream of stuff
Viewing all articles
Browse latest Browse all 239

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

$
0
0

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:


Filed under: .NET, Development, Fiddler, Software Development, Visual Studio 2010, Visual Studio and tools, Web Development

Viewing all articles
Browse latest Browse all 239

Trending Articles