Deleting a project from Hosted TFS

I added a project to the wrong TFS collection! Now what? Removed all the bindings from my solution but the TFS service now points to an orphaned entry. Unfortunately, up to this day, the TFS team have not been kind enough to supply us with a GUI tool that can delete a project from the repository and clear all references to it.

Google to the rescue. After spending several minutes looking around, the answer to this issue became apparent. The documentation is incorrect. So these are the steps required in order to delete a project from TFS.

  • Remove all bindings from your solution using Visual Studio
    File -> Source Control -> Advanced -> Edit Bindings
  • Then ensure that you use IE to log in to your TFS account and stay logged in
  • Navigate to the Visual Studio TFS tools installation location. For most people this should be the default location found here:
    C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE
  • Open the command line from this location and type the following
tfsDeleteProject.exe /collection:https://slproduction.visualstudio.com/DefaultCollection Common

The important bit to notice is the /DefaultCollection. This is the part that is missing from the utility's documentation and without it you will get TFS31002 errors.

If you are logged in and the command is correct you should then be prompted whether you want to continue as per the example below:

TFS Delete Prompt

If your answer to the above prompt is Yes, then you should see the magic happening and the following printed out in your command prompt:

TFS delete progress

And this is all there is to it. Just pay attention to the details.

Happy coding...


  • Share this post on