Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
920 views
in Technique[技术] by (71.8m points)

visual studio - Azure Devops - Deleting Workspace

Using Developer Command Prompt for VS 2019

I am able to see a list of all my workspaces.

tf workspaces /collection:"https://dev.azure.com/[ORGANIZATION]" /owner:*

I can then delete my local workspaces using:

tf workspace /delete [WORKSPACE];"[OWNER]"

If I launch Visual Studio and then rerun first command the workspace returns.

The same thing occurs if I delete the workspace from the VS UI. It will reappear as soon as I click map & get to create a new workspace of same name just deleted.


NOTES

Prior to relaunching Visual Studio I also tried:

  1. Clearing the cache folder here: C:Users[NAME]AppDataLocalMicrosoftTeam Foundation8.0Cache
  2. Deleting all my local workspace files here: C:Users[NAME]sourceWorkspaces

EDIT

After some testing I believe the issue may relate to an old workspace that had the same name. I cannot delete the old workspace because when I try to delete old non local databases I receive:

ERROR:

The workspace [WORKSPACE];[OWNER] does not exist.

I now believe the old workspace is a trace from when I migrated to Azure from old TFS.


QUESTIONS

  1. How can I delete ALL workspaces?
  2. Can workspaces be deleted from the Azure Dev Ops portal?
  3. How can you delete non local workspaces?
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To delete an existing workspace, you must be the owner or have the global Administer workspaces permission set to Allow.

You could also try to use onwer uniq ID instead of name

tf vc workspaces ws_3_3 /computer:* /format:xml /collection:https://dev.azure.com/patricklu/

ws_3_3 is your workspace name which want to delete, collection just type your collection url In the prompt up window type your address to connect to the url(If there is).

After this it will return some information such as below:

enter image description here

With info of owner uniq ID

Then you just need to use tf workspace /delete the command, in my sample it’s using:

tf workspace /delete ws_3_3;fb46f066-9122-4342-94c4-93b7526a3545

enter image description here

Simply type yes, it will delete the workspace. "Unable to determine the source control server" This may caused by you didn't include the collection url when you try to delete a workspace not locally.

1. How can I delete ALL workspaces?

There is not a command to delete all workspaces in company, you have to do it one by one.

2. Can workspaces be deleted from the Azure Dev Ops portal?

No, you couldn't do this. You should either use command line or through Visual Studio UI as below:

enter image description here Hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...