2012/09/03

TFS 2010 - The path already mapped in workspace

Today I tried to map a source control path for Microsofts Team Foundation Server 2010 on a client. Unfortunately I got the error message

The path <path> already mapped in workspace XYZ

It seemed there was already another workspaces mapped to this path. A

tf workspaces /owner:* /collection:http://XYZ:8080/tfs/COLLECTION

revealed that my suggestion was correct. I deleted the workspace by

tf workspace /delete /collection:http://XYZ:8080/tfs/COLLECTION workspacename

I thought ok, this should be it. Another try, but it failed! Some searching around in the internet showed that some people was experiencing the problem in TFS 2010 beta. It was solved by deleting the file:

C:\Users\[USER]\AppData\Local\Microsoft\Team Foundation\2.0\Cache\versioncontrol.config

or C:\Documents and Settings\[USER]\Local Settings\Application Data\Microsoft\Team Foundation\2.0\Cache on WinXP Machines

The problem occurs, because the client caches the workspace mapping and even if you delete the workspace it can occure that the mapping still remains in the Versioncontrol.config. On TFS 2010 the path is not under folder "2.0" but "3.0". You don't have to delete the whole file, you should just delete the unwanted WorkspaceInfo element:

C:\Users\USERNAME\AppData\Local\Microsoft\Team Foundation\3.0\Cache\VersionControl.config

<versioncontrolserver>
  <servers>
    <serverinfo repositoryguid="SOME-GUID" uri="http://HOST:8080/tfs/PROJECT">
      <workspaceinfo comment="" computer="COMPUTERNAME1" lastsavedcheckintimestamp="0001-01-01T00:00:00Z" name="WORKSPACE_NAME1" ownername="USERNAME1">
        <mappedpaths>
          <mappedpath path="WORKSPACEPATH"></mappedpath>
        </mappedpaths>
      </workspaceinfo>
      <workspaceinfo comment="" computer="COMPUTERNAME2" lastsavedcheckintimestamp="0001-01-01T00:00:00Z" name="WORKSPACE_NAME2" ownername="USERNAME2">
        <mappedpaths></mappedpaths>
      </workspaceinfo>
    </serverinfo>
  </servers>
</versioncontrolserver>


Sources

http://koenwillemse.wordpress.com/2009/10/29/local-folder-already-mapped-in-workspace/

http://social.msdn.microsoft.com/Forums/en-US/tfsgeneral/thread/e1dbd863-a0a7-4fd1-8b5e-387467efe596






No comments:

Post a Comment