Search This Blog

Wednesday, August 09, 2006

"The path xxx is already mapped in workspace xxx."

I was struggling with a problem I had when using TFS API I tried to map a file using:
public void Map(string serverPath, string localPath);
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.

6 comments:

tuncay said...

Thank you very much!

I was trying to solve the exact same issue..

Mark said...

Great! I was struggling with this and had no idea on how to solve it. You saved me hours. Thanks a lot.

Greg said...

Thanks!! Saved me too :)

Akash Agarwal said...

Thank You,
This is what I was loooking for. I invested so mush of my time finding it.

Mark said...
This comment has been removed by the author.
Rajeshwari said...

Hi,
I have same problem , The path xxx is already mapped in workspace xxx. I saw your solution,
To resolve this problem delete all the keys from the config file.?
Can you tell how to delete keys ?
Don't delete the file because you'll get it again from the server cache. ? what it mean ?