How to delete a team project from Team Foundation Service (tfs.visualstudio.com)


[UPDATE 9/13/13] You can now use the web UI to delete a team project.

[UPDATE 5/14/13] Updated the URLs and version of VS (used to say preview)

The question came up as to how to delete a team project in the Team Foundation Service (TFService).  When I first tried it, it didn’t work.  Then I realized it’s the one case where you have to explicitly specify the collection name.  It’s surprising because in hosted TFS each account has only one collection.  You cannot create multiple collections currently as you can with on-premise TFS (this will change at some point in the future).  Incidentally, you cannot delete a collection right now either.

You must have installed the Visual Studio 2012 RTM or newer build to do this (you can also use the standalone Team Explorer 2012).  Even with the patch to support hosting, the 2010 version of tfsdeleteproject.exe will not work.

If you leave off the collection, here’s the error you will see when I try to delete the team project called Testing.

C:\project>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com Testing
Team Foundation services are not available from server https://buckh-test2.visualstudio.com.
Technical information (for administrator):
  HTTP code 404: Not Found

With DefaultCollection added to your hosting account’s URL, you will get the standard experience with tfsdeleteproject and successfully delete the team project.

C:\project>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com/DefaultCollection Testing

Warning: Deleting a team project is an irrecoverable operation. All version control, work item tracking and Team Foundation build data will be destroyed from the system. The only way to recover this data is by restoring a stored backup of the databases. Are you sure you want to delete the team project and all of its data (Y/N)?y

Deleting from Build …
Done
Deleting from Version Control …
Done
Deleting from Work Item Tracking …
Done
Deleting from TestManagement …
Done
Deleting from LabManagement …
Done
Deleting from ProjectServer …
Done
Warning. Did not find Report Server service.
Warning. Did not find SharePoint site service.
Deleting from Team Foundation Core …
Done

This is the error you will get when using tfsdeleteproject 2010, even with the patch for hosting access.

C:\Program Files\Microsoft Visual Studio 10.0\VC>tfsdeleteproject /collection:https://buckh-test2.visualstudio.com/DefaultCollection Testing2

Warning: Deleting a team project is an irrecoverable operation. All version control, work item tracking and Team Foundation build data will be destroyed from the system. The only way to recover this data is by restoring a stored backup of the databases. Are you sure you want to delete the team project and all of its data (Y/N)?y

TF200040: You cannot delete a team project with your version of Team Explorer. Contact your system administrator to determine how to upgrade your Team Explorer client to the version compatible with Team Foundation Server.

Comments (64)

  1. Enrique Lima says:

    Great info!  Thank you!

  2. Jörg B. says:

    Buck,

    thanks for the info – however, using the VS2011 preview installation and its TFSDeleteProject.exe doesn't work. Well it seems to stall once I've entered '"C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDETFSDeleteProject.exe" /collection:"myaccount.tfspreview.com/Defaul

    tCollection/"  MyProject' (without the leading and trailing '). And then it came to me.. how would authentication work? I mean, on the website etc it works via my Live account, but how would that work from the command line?

    Is that the reason why it's simply sitting there (not asking for confirmation, just 'froze' after hitting enter) the past 10 minutes?

    Thanks,

    -J

  3. buckh says:

    Jörg, sorry for the delay.  Someone will be looking into it this week.

    Buck

  4. buckh says:

    Jorg, I asked a couple of devs to look into it, and we could not repro the problem with tfsdeleteproject.exe (we did see some issues with tf.exe).  We believe that there may be a credential dialog that is positioned off screen for some reason.  See if you can locate by alt-tabbing through the windows.  If not, an alternative is to delete the UISettings.config file, which is in a path like the following C:UsersbuckhAppDataLocalMicrosoftTeam Foundation3.0Cache.

    Buck

  5. Christophe Trevisani Chavey says:

    Can we download tfsdeleteproject.exe without having to install vs2011 preview?

    Or it must get some assemblies/updates from vs2011 :/

  6. buckh says:

    Christopher, you will need to install VS 2011 preview to get it.  We don't yet have a web UI to allow you to do the operation, unfortunately.

    Buck

  7. DSK Chakravarthy says:

    My first impression is this, how does it recognised my login credentials of TFSPreview from console?

    The expected answer would be that, the console app read the information from the cookie that is stored on my client side.

    If that is so, isn't it a weaklink in the product?

  8. dskc says:

    The mentioned commands worked on the 2nd attempt. But not the first time. Any clue as why?

  9. buckh says:

    Chakravarthy, if you have elected to remain signed in from IE or VS, it should recognize that.  Otherwise, it should pop up the browser window for you to sign in.  I'm not sure why it failed the first time but worked the second.  We've made quite a few fixes since then. One area where we made fixes since the preview build has been around handling expirations.  So it could have been a bug where it didn't handle the expiration properly.  Let me know if this happens when the next public release is available (sorry, I can't say when that is).

    Buck

  10. Ken Stone says:

    Thanks. This worked for me. I did get some "Access Denied" messages at the end of the process (just after "Deleting from ProjectServer"), but the project I wanted to delete was in fact gone from the web display.

  11. John Gardner says:

    strangely, even after a page refresh, the deleted projects still show up in the "Projects" dropdown at the top of the page.  Trying to access them goes to an error page that the projects don't exist (which i expected).  

    Once i selected "back to the welcome page" from the projects dropdown, they disappeared from the projects menu.

  12. buckh says:

    John, I think you are seeing the list of most recently accessed projects.  We do not clean those up when a team project is deleted.  There is an 'X' by each that you can use to remove them from the list.  At some point we may clean up the lists automatically.

    Buck

  13. Is it possible that the TFSDELETEPROJECT.exe is missing in the latest version (Microsoft Visual 2012 RC)?

  14. Found it: C:Program FilesMicrosoft Visual Studio 11.0Common7IDE>tfsdeleteproject

  15. buckh says:

    Sebastian, glad you found it.

  16. Buzz says:

    Glad there is a way to do this, and now that I know how I can do it. But…  command line??? Really?!?

  17. buckh says:

    I hear you. We'll get that fixed at some point.

  18. Michel says:

    I keep getting TF30063 without being able to log in? Anyone a solution

  19. buckh says:

    Try logging out at both <youracct>.visualstudio.com and live.com. Then try it again.

  20. Mohsen says:

    Hi

    I'm getting this:

    Deleting from Legacy …

    HTTP code 404: Not Found

    Deleting from ProjectServer …

    Done

    Warning. Did not find Report Server service.

    Warning. Did not find SharePoint site service.

    The team project could not be deleted. Either the delete operation failed, or project creation failed but the partially-created project could not be deleted. Review the previous entries in this log for details. The team project has been taken offline and remains in a non-operational state. It is not accessible to Team Explorer. To complete the deletion, address the errors noted in this log, and then attempt deleting the project again.

    I tried again and the same.

    Any idea?

  21. buckh says:

    Mohsen, unfortunately we broke it with Monday's deployment. We are working on a hotfix now for deployment on Monday (hopefully). Sorry for the inconvenience!

  22. Mike Anderson says:

    Thanks Buck! Really need a fix soon!

  23. buckh says:

    Mike, we pushed a fix today. Let me know if it is not working for you now.

  24. Mike Anderson says:

    Works good! Thanks!

  25. buckh says:

    Great! Sorry for the trouble.

  26. This is the most stupid thing MS has come up with yet. It's way too difficult to delete a Team Project. Just give let me click a button or a red 'X ' and I'll delete it. Good grief…

  27. Andy Creigh says:

    Well said pointeman, Buck, any idea when there will be something in the interface to do this?

  28. buckh says:

    I understand the frustration, but I don't have a timeline to share yet, unfortunately.

  29. Akshat Dubey says:

    Hi, i have currently wasted over 3 hours just to delete a project. besides the glaringly obvious suggestion of just having a web interface to do that or via source control, i need help. when i follow the instructions given and open the tfsdeleteproject.exe via the developer command prompt (yes, in admin) no matter what i do, it doesnt give me any errors or show any sign of communicating with the tf servers. it just brings me back to the directory. then when i repeat the command, it shows the usual info on how to use the thing and then closes again, without regard for any lines i have written after the tfsdeleteproject.exe

  30. buckh says:

    Akshat, I'm sorry to hear that. Is this happening with the 2012 tfsdeleteproject.exe?

  31. I am using VS2012sp1 on my pc and the MS hosted(cloud) version of TFS says:

    is this solution supposed to work with this configuration? I thought I had the cmd line exactly the way it was described but the cmd fails with every variation I try

  32. buckh says:

    Do you mean VS 2012 with Update 1? So long as you have at least VS 2012 RTM, you will be able to use tfsdeleteproject.exe to delete the project. It will not work with VS 2010 (any release or patch level).

  33. LittleKingKong says:

    Why the hell they did not make a button to delete the project ?

    Just ask the password twice to confirm the deletion… What the hell…

  34. I suceeded in deleting the Azure TFS project says:

    according to info presented on this page, I successfully deleted my Azure TFS test project with:

    "C:Program Files (x86)Microsoft Visual Studio 11.0Common7IDETFSDeleteProject.exe" /collection:"https://<userName&gt;.visualstudio.com/DefaultCollection/" <projectName>

    (supply your appropriate values in <> places, of course :-))

  35. Fergal says:

    I appear completely unable to delete a TFS Project on visualstudio.com.

    Tried your suggested method, and it gave a TF200040 error. I even opened powershell and manually navigated to D:Program Files (x86)Microsoft Visual Studio 11.0Common7IDE before executing:

    .tfsdeleteproject /force /collection:https://<user&gt;.visualstudio.com/DefaultCollection <project>

    (values replaced as necessary)

    It still gave me to 200040 error. My VS version is Update 2 (11.0.60315.01)

  36. Paaa says:

    Same issue here. But I'm pretty sure that yesterday it worked!

  37. buckh says:

    Fergal and Paaa, I've sent this to the team to investigate. Our deployment yesterday may have broken this, and we'll need to deploy a fix.

  38. Curt says:

    I can confirm I'm having the same issue as Paaa. Also, when I issue the delete command, it says it fails. However, you no longer can see the project in visual studio or on visualstudio.com. But if you try to create a new project with the same name as a project that was attempted to be deleted, you will get an error that that name already exists.

    I only noticed this when I updates to Update 2 yesterday. I'm attempting to rollback that update now.

  39. Curt says:

    Just to follow up…rolling back didn't fix the issue…same problem.

  40. buckh says:

    We know where the break is, and we are working on a fix. Sorry about the disruption!

  41. Robert says:

    Getting the TF200040 error, hoping that there will be a way to subscribe to replies to this thread via email after I hit 'Post' so I don't have to keep coming back here to check for updates…

  42. Mechanical says:

    Same problem here : Windows 8 , VS 2012, (VS 2010 is not even installed)

    C:Program FilesMicrosoft Visual Studio 11.0Common7IDE>TFSDeleteProject.exe /

    collection:https://<username&gt;.visualstudio.com/DefaultCollection "collection name"

    Warning: Deleting a team project is an irrecoverable operation. All version cont

    rol, work item tracking and Team Foundation build data will be destroyed from th

    e system. The only way to recover this data is by restoring a stored backup of t

    he databases. Are you sure you want to delete the team project and all of its da

    ta (Y/N)?y

    TF200040: You cannot delete a team project with your version of Team Explorer. C

    ontact your system administrator to determine how to upgrade your Team Explorer

    client to the version compatible with Team Foundation Server.

    C:Program FilesMicrosoft Visual Studio 11.0Common7IDE>

  43. buckh says:

    The fix should go out tomorrow.

  44. Mechanical says:

    Thanks Buck for the update.

  45. Same issue , VS2010 And Vs2012 TeamExplorer, keep goiing , your team do a good Job, and TFService is great !

  46. Simon says:

    Just started to use TFservice but having problems deleting – TF200040 Any news on the release?

  47. Paaa says:

    Thanks for the fix. works again!

  48. buckh says:

    Paaa, we just did the deployment. I can't believe you noticed it that fast! I am glad to hear that you are able to confirm it is working for you.

  49. Mechanical says:

    I confirm.Just tested. It works!

    Thanks for your efforts.

  50. it's Works,

    Thank's all the team

  51. EK says:

    Hi.

    What if I want to delete a project that is not in the first level of projects under my collection? For instance, if I want to delete the project with the path <DefaultCollectionMyTeamProjectSubProject>? (I've tried <tfsdeleteproject /collection:mytfs.visualstudio.com/DefaultCollection MyTeamProject/SubProject> but that did not work)

  52. buckh says:

    EK, only the top-level items are team projects. Anything below that is just a folder. You can use tf destroy to permanently remove that subfolder or just delete it if you want to maintain history but remove it from sight.

  53. RockCityGhost says:

    I can't believe this still isn't in the UI… I don't get it…

  54. CarlosCampos says:

    Now we have this option in the UI. Just go to the collection's admin page "yourname.visualstudio.com/…/_admin" and you'll find the delete option.

  55. buckh says:

    CarlosCampos, you are correct that it's gotten easier to get there now. I will update the post with that information.

  56. David says:

    What do I do if TFSDeleteProject does not exist in the path you say that it does?

  57. buckh says:

    David, you can do it from the web UI now: blogs.msdn.com/…/how-to-delete-a-team-project-from-team-foundation-service.aspx. You don't need to use the command line.

  58. Craig says:

    I was deleting a project from our local TFS instance, on the last step, "deleting from Team Foundation Core", it timed out.   Now the project is not listed anymore but I am concerned that there is some left over "residue" in the system since the last step doesn't look like it completed.

    Is there a way to validate?  I tried to run the command again but it just says that the project doesn't exist.

  59. Craig says:

    Sorry forgot to mention this is TFS 2010

  60. buckh says:

    Craig, please run tfsdeleteproject /force with the project name. That should clear out anything left. If not, let me know.

  61. Craig says:

    I tried the force command, the project isn't listed anymore it just says that the project doesn't exist.

    My concern is that the last step in deleting failed and I didn't want any leftover data in TFS, it was the last step "Team Foundation Core"

  62. buckh says:

    Craig, you should be in good shape. /force will try to delete the different parts of the project, and it's not finding anything left..

  63. Craig says:

    Thanks for the help!