10
votes

I want to add my project from Visual Studio 2012 to my TFS server, but it says the path is already mapped for workspace pc;administrator (this is a local workspace).

I have tried the command tool tf but it says that there are no workspaces, so I can't delete the workspace that is conflicting.

I'm running Windows 8 with Visual Studio 2012. TFS is on a windows server 2012.

6
Did you map your local workspace to a different TFS Server (or TFS Preview)? Also, is this a team project or a local project? Has this project ever been associated with a different TFS Server?Andrew Clear
It is a new project, created in visual studio. But i did create a project yesterday with the same name that i deleted again. Been testing TFS. So it could be that the system thinks the project from yesterday still exists on that file location. Thats why i need to delete the workspaces.Poul K. Sørensen
Have you deleted the project in windows explorer from your local workspace?Andrew Clear
Yes i just deleted the folder from windows explorer.Poul K. Sørensen
i dont know where to press ctrl+q?Poul K. Sørensen

6 Answers

12
votes

The problem is that the current project location, the folder on your physical machine, is mapped to a different TFS server. To add it to source control you need to move it to a physical location not associated with a TFS server.

Edit To remove the offending workspace:

1) Use the "Team" menu to connect to the TFS Server that you do NOT want to be mapped to

2) Use ctrl+q --> workspaces to access the workspaces menu

3) Remove the workspace

4) Change to the TFS Server you WANT to be mapped to using the "Team" menu again

5) ctrl+q --> workspaces

6) Add a new workspace

3
votes

Try any of these steps out. Some of them may not be applicable to you.

To clear up "cached workspace" and remove workspace mapping.

  1. On Control Panel > User > Credential Manager Remove Windows Account and Generic Account that points to TFS.
    How can I change the default credentials used to connect to Visual Studio Online (TFSPreview) when loading Visual Studio up?

  2. On IE, remove cached password.
    http://www.jayway.com/2012/12/17/changing-tfs-credentials-in-visual-studio-2012/

  3. Remove stored username/password:
    http://blogs.msdn.com/b/visualstudioalm/archive/2012/08/29/clearing-the-credentials-for-connecting-to-a-team-foundation-server.aspx

    rundll32.exe keymgr.dll,KRShowKeyMgr

  4. Delete workspace. On VS2012 command line, run the following:

    tf.exe workspace /delete workspacename;owner /server:serveraddress
    http://mycomputeradventures.blogspot.com/2012/01/removing-tfs-workspaces-from-old-users.html

  5. Clear Up cached workspace mapping. On VS2012 command line, run the following:

    tf.exe workspaces /remove:* (or /s:http//oldserver:8080)
    http://blogs.msdn.com/b/buckh/archive/2006/09/12/path-is-already-mapped-in-workspace.aspx

2
votes

if you use Visual studio 2012 go

C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4.0\Cache

or if it is Visual studio 2013 go

C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\5.0\Cache 

Remove all things under it.

1
votes

Simplest way to do this is to go to your AppData and delete the TFS cache (depending on the version 3.0 or 4.0)

C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\3.0\Cache or C:\Users{UserName}\AppData\Local\Microsoft\Team Foundation\4.0\Cache

1
votes
  1. First we will check the list of workspaces from VS 2015 Developer command prompt,

    Ex - tf workspaces /owner:*

  2. Now we will get the xml format from VS 2017 Developer command prompt which will have ‘owner id’ for the particular workspace,

    Example 1 - tf.exe workspaces /owner:* /computer:ComputerName /collection:https://YOUR-TFS-URL.visualstudio.com /format:xml

  3. We can now delete the workspace for the particular user,

    Example 1- Tf workspace /delete ComputerName;[email protected] /server:"https://URL.visualstudio.com"

    OR

    Example 2 - Tf workspace /delete ComputerName;1e178c77-bb8b-6f05-bf99
    /server:https://URL.visualstudio.com

    (Where 1e178c77-bb8b-6f05-bf99 is ID of the workspace which you get from Step 2 XML format)

  4. Again we will check the list of workspaces from VS 2015 Developer command prompt,

    Ex - tf workspaces /owner:*

0
votes

Well I couldnt find my troublesome workspace, which prompted me to copy the local code folder into another name and I created a new workspace mapping that folder.

Next up I added the new solution to the TFS via VS 2012 using Add Source Control.