How do you force the deletion of a TFS 2010 workspace on a client when the TFS Server no longer exists?

旧时模样 提交于 2019-12-03 07:43:08

The working folder mappings for all the local workspaces is stored in the version control cache file. This allows you to bootstrap TFS clients, allowing them to locate the server information for a given local folder. In addition, it will provide the information for this test you're seeing, that prevents a local folder from being mapped to two different servers.

In order to clean this up (without trying to connect to the server), you can use the tf workspaces command (note the pluralization - the workspaces command operates on the list of workspaces, the workspace command operates on a workspace and generally requires connectivity to the server that workspace is located on.

To delete all workspaces for your deleted project collection, you can do:

tf workspaces /remove:* /collection:http://server-2:8080/tfs/DefaultCollection

(Obviously replacing the project collection URI with the URI for your deleted server.)

I had exactly the same issue: After moving TFS server to another machine, I couldn't map to a local folder in VS2012 on the old machine because it was still associated with an old Workspace that TFS denied all existence of. After many hours (and days) searching Google and trying different things, none of which worked (including all the "tf" commands, deleting the local cache etc), this is how I eventually solved it:

  1. Edit the actual TFS collection database on the TFS server using SQL Management Studio Express (e.g. "Tfs_DefaultCollection")
  2. Look for the "dbo.tbl_Workspace" table and edit it
  3. You should see your "ghost" workspace(s) in here
  4. Delete the rows
  5. All is right in the world

The workspaceowner parameter on the delete command is optional. Can you issue the delete without that parameter, or will that damage another MY-CLIENT workspace?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!