Search code examples
visual-studio-2013workspacetfs-2015tfvc

TFS 2015 workspace keeps coming back after delete


I can't remap my dev folder to TFS 2015 after an upgrade. Here's what I've done:

  • Migrated from TFS 2010 to TFS 2015 by:
  • Backing up the TFS databases and restoring them on to the new server (SQL 2014)
  • Installing TFS 2015
  • Running the upgrade wizard

The new server has replaced the old one and has the same IP address. My dev machine is Windows 10 Enterprise and my user is in the admin group. UAC is off.

  • I connect to TFS in VS2013; I then go to Team Explorer > Configure Workspace, and enter the folder containing my solutions.
  • I click Map & Get, and it tells me:

The working folder XXXX is already in use by the workspace YYYY;MyUser on computer MyComputer

  • I click Advanced, and it lets me remove the workspace.

However, when I attempt to remap the same folder, I get the same message.

I've also deleted the workspace using the command line (tf workspace /delete); the delete appears to work since when I try to delete it again, it tells me the workspace doesn't exist.

However, no matter how I try to remap the same folder, the workspace keeps coming back.

  • I've also deleted the cache in C:\Users\Myuser\AppData\Local\Microsoft\Team Foundation\5.0\Cache

  • I've queried tbl_Workspace and tbl_WorkspaceMapping in the actual TFS database and sure enough, the workspace is indeed there.

How can I get rid of it completely?


Solution

  • Ok, it turned out that the key was that although the IP of the new server is the same as the old one, its name is different.

    Once connected to the new TFS, in Visual Studio Team Explorer, I seemed to have access only to workspaces created on the new one.

    With the tf command line utility, I could get at the other ones. So for example:

     tf workspaces /owner:OldServerName\Myuser /server:http://ServerIP:8080/tfs/CollectionName
    

    ...would list all the workspaces I'd used on the old server.

    The clue that gave it away was that initially I specified /owner:MyUser, and it told me that the user specification was ambiguous (I use the same user name on the new server as the old one). Once I qualified it with the old server name, everything just worked.

    Then:

    tf workspace /delete /collection:http://ServerIP:8080/tfs/CollectionName /login:OldServerName\MyUser workspacename
    

    ...resulted in a password prompt. I entered the password, and the workspace was deleted.

    Listing them again didn't show the deleted one, and a query on tbl_Workspace in the underlying TFS database confirmed that the workspace was indeed gone.

    Once I'd cleared out the workspaces from the old server in this way, I could create a new workspace in VS Team Explorer and map my projects.