Wednesday, June 26, 2019

D365FO delete TFS workspaces (ghost workspace)

Hi,

It becomes headache one needs to change TFS account on Visual Studio. Following these steps may save your lots of time cleaning your previous workspace and configure new one. First try the lucky way if it didn't for you go for painful way.

Lucky way:

1- Close Visual Studio

2- Open Run (Win+R) and paste one by one the following and delete anything inside:
    %localappdata%\Microsoft\Team Foundation\6.0\Cache\
    %localappdata%\Microsoft\VisualStudio
    %localappdata%\Microsoft\VSCommon
3- Restart your VM

4- Open visual studio and configure with new account

Painful way:

1- Close Visual Studio

2- Open Run (Win+R) and paste one by one the following and delete anything inside:
    %localappdata%\Microsoft\Team Foundation\6.0\Cache\
    %localappdata%\Microsoft\VisualStudio
    %localappdata%\Microsoft\VSCommon
3- Open command and run following commands:
  • Goto IDE folder where the workspace program exist
    Cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
  • Check all the current workspaces
    tf workspaces /server:https://dev.azure.com/{org} /computer:{ComputerName} /owner:* /format:detailed
  • If you see any ghost workspace delete it
    tf workspace /delete /server:https://https://dev.azure.com/{org} '{WorkspaceName};{UserName}

    if above command give error run it with user id instead of username
    tf workspace /delete /server:https://https://dev.azure.com/{org} '{WorkspaceName};{UserId}
  • Run this command to sure it's deleted
    tf workspaces /server:https://dev.azure.com/{org} /computer:{ComputerName} /owner:* /format:detailed

4- Restart your VM

5- Open visual studio and configure with new account


Comment if you stuck anywhere, I have wondering around this for 2 days, will try to help in anyway.