Note to Self: TFS and VS Startup

February 9, 2011

{Every now and then I find that I have to do some kind of configuration magic to get my development environment working the way I want it to. I promptly forget it until I have to do it again 3-6 months later when I replace my machine. By then I have no idea what I did so I have to look it up again. The point of this Note to Self series is to remind me of exactly what I did so I don’t have to try to remember the name of some odd command line tool and the various parameters that go along with it.}

Let me start by saying that I’m a big fan of Team Foundation Server (TFS). I think the product has come a long way since it’s initial release in 2005. I wish it had some more features that could make it a distributed version control system (i.e. Git and Mercurial), but all in all it’s a good product

With that said, one of the things I’m not a fan of is how Visual Studio (VS) attempts to connect to TFS on startup. There are two specific reasons I don’t like this. First, it slows down VS startup. Second, I have multiple clients, not all of whom expose their TFS instances over http/s. If the last instance of TFS I was connected happens to belong to one of these clients, not only do I have to wait for the long startup, I have to endure a dialog telling me that VS could not connect to TFS. This is especially frustrating when all I want to do is create a simple console app to test out an idea or two. It’s so frustrating, that I’m acutally getting frustrated right now as I write this. Grrrr….

Luckily all is not lost and this no longer needs to be endured. With a small registry tweak you can prevent VS from connecting to TFS (2005, 2008, and 2010) on startup. Here’s what you do:

1. Backup your registry. Don’t skip this step. SERIOUSLY! DON’T SKIP IT!

2. Navigate to Team Foundation key:

For VS 2005 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\8.0\TeamFoundation

For VS 2008 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\TeamFoundation

For VS 2010 navigate to: HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\10.0\TeamFoundation

3. Add a registry key “AutoLoadServer” (type DWORD)

4. Setting the value to be 0 (Do not connect automatically or 1 to connect automatically).

This has made me a happier, well less frustrated, developer. I hope it does the same for you.