Monday, February 05, 2007

TFS: Unable to connect to the remote server

When trying to add a project to Team Foundation Server Source Control, the following dialogue box appears:

Reason:
Can be caused when workspace is not mapped correctly.

Resolution:
  1. Select TFS server in Team Explorer.
  2. Go to File > Source Control > Workspaces.
  3. Highlight your computer name and click 'Edit'.
  4. Select the root of the server, and select the local root you want to use (ie. visual studio 2005/projects).
If you get an error stating that the workspace location is already mapped, it may be because you have been using a different TFS server in the past. If so, remove the old workspace first, using the utility described here: http://msdn2.microsoft.com/en-us/library/54dkh0y3(VS.80).aspx

If the server no longer exists, you will not be able to remove the workspace with the tf workspace utility. In this case, you need to open the versionControl.config file found here:

C:\Documents and Settings\[user]\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache\versionControl.config

Once you have opened the file in a text editor, remove the references to your old server by removing the node entirely, or change the workspace path.

Once you have done this, complete the steps above to set up your workspace.