Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't remove workspace from TFS

Tags:

tfs

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.

like image 564
Poul K. Sørensen Avatar asked Sep 13 '12 17:09

Poul K. Sørensen


3 Answers

  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:*

like image 104
Divyanshu mehta Avatar answered Oct 23 '22 17:10

Divyanshu mehta


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

like image 37
user2048576 Avatar answered Oct 23 '22 19:10

user2048576


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

like image 30
Andrew Clear Avatar answered Oct 23 '22 18:10

Andrew Clear