Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a TFS Workspace Mapping?

Tags:

jenkins

tfs

People also ask

How do I remove a map from VST?

Answers. You can remove the mapping in the Manage Workspaces dialog (File -> Source Control -> Workspaces...) Pick your workspace and remove the entry for that mapping. Then hit OK.


From VS:

  1. Open Team Explorer
  2. Click Source Control Explorer
  3. In the nav bar of the tool window there is a drop down labeled "Workspaces".
  4. Extend it and click on the "Workspaces..." option (yeah, a bit un-intuitive)
  5. The "Manage Workspaces" window comes up. Click edit and you can add / remove / edit your workspace

source control explorer

From VS on a different machine

You don't need VS to be on the same machine as the enlistment as you can edit remote enlistments! In the dialog that comes up when you press the "Workspaces..." item there is a check box stating "Show Remote Workspaces" - just tick that and you'll get a list of all your enlistments:

show remote workspaces

From the command line

Call "tf workspace" from a developer command prompt. It will bring up the "Manage Workspaces" directly!


I ran into the same problem, and was able to fix it by manually deleting all the files in the TFS cache, located here:

%LocalAppData%\Microsoft\Team Foundation\3.0\Cache

or 4.0, 5.0, etc.


Follow these steps to remove mapping from TFS:

  1. Open team explorer
  2. Click Source Control
  3. Right click on you project
  4. Click on Remove Mapping

The error is genuine. You might have created workspace with same name on different machine. Now you may have changed machine having different machine name.

So here is work-around that will definitely work.Following is work-around.

  1. Go to "Team-Explorer"
  2. Go to "Source-Control"
  3. Go to Workspace drop-down
  4. Click on "Workspaces..."
  5. A pop-up window will appear
  6. Click on "Show remote workspaces"
  7. Now delete the workspace which is conflicting and you can proceed your work.

Please follow the below steps:

Ctrl + Run 

Copy and Past

%LocalAppData%\Microsoft\Team Foundation

You will get different version of TFS e.g enter image description here

Click on each folder and you will get

enter image description here

Now Delete all data in these folder.

Reopen the Visual studio.

Thanks.


Update 2019-01-23

If you’re repeatedly getting the following error The workspace wkspaceEg does not exist… even after employing the correct username (wkspcOwnerDomain\wkspcOwnerUsername) in the tf workspace command, e.g.,

tf workspace "wkspaceEg;wkspcOwnerDomain\wkspcOwnerUsername" /collection:http://tfs.example.com:8080/tfs/collectionEg /login:TFSUsername,TFSPassword

then the tf workfold command may help fix it. See this question.

If even that doesn’t work and you’re unable/unwilling to use TFS Sidekicks, proceed to the risky last-ditch option below.


I’m using TFS 2012. I tried everything that was suggested online: deleted cache folder, used the workspaces dropdown, tf workspaces /remove:*, cleared credentials from Control Panel, IE, etc.

Nothing worked, I believe my workspace got corrupted somehow. Finally, I went to the TFS database and ran the following queries. That worked! Of course be very careful when messing with the database, take backups, etc.

The database is called Tfs_<<your_TFS_collection_name>>. Ignore the Tfs_Configuration MSSQL database. I'm not sure but if you don't have a Tfs_<<your_TFS_collection_name>> database, settings might be in the Tfs_DefaultCollection database. Mapping is stored in tbl_WorkingFolder.LocalItem.

/*Find correct workspace*/
SELECT WorkspaceId, *
FROM tbl_Workspace
ORDER BY WorkspaceName

/*View the existing mapping*/
SELECT LocalItem, *
FROM tbl_WorkingFolder
WHERE WorkspaceId = <<WorkspaceId from above>>

/*Update mapping*/
UPDATE tbl_WorkingFolder
SET LocalItem = 'D:\Legacy.00\TFS\Source\Workspaces\teamProjEg' WHERE
/*LocalItem = NULL might work too but I haven't tried it*/
WorkspaceId = <<WorkspaceId from above>>