Wondering why my unit tests were suddenly not running under TFS on our build server, I finally decided to delete and recreate the build definition. I kicked off a TFS build with the new build definition and got a log that consisted of just this error:
The path <blah> is already mapped in workspace <blah>.
One post on StackOverflow.com suggested running the command...
tf workspaces /owner:*
...to get a list of workspaces and then running...
tf workspace /delete WORKSPACENAME;OWNER
...where WORKSPACENAME is the name given in the error message and OWNER is the owner of the workspace (TFSService in our case). That was sound advice, but some facts were missing. Maybe they'd be obvious to someone better-versed in TFS than I, but here they are.
- You'll need permissions in TFS to delete the workspace.
- The command prompt should be on a client machine, not on the build server. That's because of the next requirement.
- In the command-prompt window, you should be in a directory that is contained in the workspace.
That worked for me. If it doesn't fix the problem for you, see the post I referenced for more suggestions.
BTW, my unit tests still didn't run. Maybe I'll post about that next, after I solve the problem.