When creating a new build in Team Foundation Server, I get the following error when attempting to run the new build:
The path C:\Build\ProductReleases\FullBuildv5.4.2x\Sources is already mapped to workspace BuildServer_23.
I am unable to see a workspace by that name in the workspaces dialog.
For some reason I was having trouble deleting the workspace from the command-line utility. Luckily I found Team Foundation Sidekicks 2010 (from this post) which is free and provides a GUI for viewing and deleting TFS workspaces, and many more useful TFS features.
I tried all the following solutions such as :
The following worked for me:
I had a similar problem with Visual Studio 2010 complaining about an already-mapped-workspace, but instead of deleting the entire workspace, I used the following from the Visual Studio Command Prompt: "tf workspace PROBLEM_WORKSPACE_NAME". This brought up an "Edit Workspace" dialog. From there I was able to remove the path in question from the "Working Folders" list, which got rid of the error.
I was getting an exception telling me that the file was already mapped in another workspace: "The path {File Path} is already mapped in workspace {Workspace Name}."
This workspace was deleted beofre. With the help of friend of mine I found out that TFS save workspace info under the user local settings dir. We found a file named:
VersionControl.config under {User Documents and Settings dir}\Local Settings\Application Data\Microsoft\Team Foundation\1.0\Cache. This file contains all the local mapping of TFS. Probably when you use the Map method and don't use: public void DeleteMapping(WorkingFolder mapping); before deleting the workspace the mapping information is not removed from this file which is used by TFS to check if you've alreay mapped a specific path.
To resolve this problem delete all the keys from the config file. Don't delete the file because you'll get it again from the server cache.
While trying to 'Get latest version' of a project which I had previously mapped to a local directory and then deleted, I saw this same error message. First I tried the SideKick tool and then the Visual Studio 2010 command prompt, both of which told me I had no workspaces mapped.
Next I searched for 'VersionControl.config' within
c:/users/myuser/appdata
, and deleted the 4 references it found. I re-opened Visual Studio and I was able to re-map the project, no more error!My issue was related to using multiple accounts. This is how I was able to switch accounts.
Open Team Explorer
From the big drop down menu near the top of the pane...
Navigate to: Projects and my Teams>Manage Connections
Navigate to: Manage Connections>Connect to Team Project
Use the "Switch User" link to switch accounts.
Now the workspace names will match the chosen account.