28

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?

Tony L.
  • 17,638
  • 8
  • 69
  • 66
Kevin
  • 281
  • 1
  • 3
  • 4

7 Answers7

54

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

Alessandro Lallo
  • 741
  • 11
  • 21
  • 2
    It is now File -> Source Control -> Advanced -> Workspaces – pat capozzi Nov 26 '13 at 21:46
  • For those with Multiple TFS Repositories, first ensure that you are connected to the correct repository first (Team -> Connect to Team Foundation Server) – StuartLC Mar 02 '15 at 11:04
20

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

hyprsleepy
  • 1,810
  • 6
  • 25
  • 35
  • This worked for me. I'd checked out with slightly different paths on two different machines, causing various build issues. I'd try this first, and then use crystal86's solution. I've had to use that before also. – Guerry Mar 02 '12 at 19:54
8

Cloak and then uncloak the affected folders worked for me.

Adamy
  • 2,789
  • 3
  • 27
  • 25
  • Cloak and then uncloak the folder mapped wrong. It still showing the wrong Local Path in Source Control Explorer. Do a Get Last Version in this folder will change the Local Path to the correct path. It works for me. – RenanStr Apr 25 '17 at 13:55
  • @user1203003 apparently my answer four years ago only applies for TFS 2010 in VS 2010. Things change now. – Adamy Apr 26 '17 at 03:11
1

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.

1

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.

BuzyBuzy
  • 11
  • 1
  • Edit workspace, Add mapping seems to work. But, it pulls the latest source from all mappings! Prefer to provide the feedback to Visual Studio team so that they can provide a better option. – vijayst Feb 10 '14 at 08:35
0

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.

prakash
  • 17
  • 1
0

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.

Tony L.
  • 17,638
  • 8
  • 69
  • 66