28
votes

Running VS 2010, I want to now build on TFS 2010. In Team Explorer, I change my connection from our old TFS 2008 build server to our new TFS 2010 server. Now I want to map my source control from the old local directory (C:\TFS) to new directory (C:\TFS2010). Using File -> Source Control -> Workspace, I can change the top level mapping of our projects to the new location, clicking the "recursive" check box.

However, I notice that while the top level mapping changes, the local paths for the second tier folders don't change.

I tried removing all mapping, and I tried refreshing. Tried restarting VS2010. Tried renaming the old directory – that wasn’t allowed.

I haven't tried getting latest from the top level, as that would take way too long and I probably don't have that much disk space.

Oddly, If I go to File -> Source Control -> Cloak while selecting a second tier project folder, it seems to think the mapping has already been updated for that tier.

Any ideas how I can re-map all my projects (or even just some of them), to a different local path?

7

7 Answers

54
votes

or File -> Source Control -> Workspaces -> Choose the workspace in question and you can remove and create it again

20
votes

File -> Source Control -> Workspaces -> Choose the workspace in question and click "Edit".

8
votes

Cloak and then uncloak the affected folders worked for me.

1
votes

The only answer I've been able to find so far is to edit your workspace definition and add a specific mapping for your TFS project. However, don't add a mapping that would be normally handled by the root level mapping cause if you do your setting will be ignored. If you add a unique mapping for your project it does seem to work. Not a perfect answer.

Since you can right click and remap the root I think the functionality was overlooked that would aloow you to right click and reset a project folder's specific mapping.

Looking forward to a better answer.

1
votes

If you want to change the local path for the working directory of the Team Foundation Server (TFS), you need to go to File -> Source Control -> Advanced -> Workspaces, then select your workspace and click Edit. TFS Image In the next dialog change the mapping for the root TFS node to the new location on your hard drive.

0
votes

remove the mapping from the root folder, once this is done you will be able to change the path.

Since the Root folder is mapped it is locking the entire structure to the same path.

0
votes

TFS mapping can also be changed through Source Control Explorer. This is in Visual Studio 2017.

  1. Open Source Control Explorer under Team Explorer

Open Source Control Explorer

  1. Right Click your TFS folder->Advanced->Remove Mapping (You can change mapping without removing here in VS 2017)

Right click menus

  1. Change your Local Folder and click Change

Change Mapping

From here, it will create the new folder if it doesn't already exist and map/download from TFS.