There are many ways to delete a TFS project that is not being used. One way to do that is by using the command line and TFSDeleteProject executable file which is available in C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE
or under Microsoft Visual Studio 11.0 depending on the version of Visual Studio we are using.
The syntax for deleting a project from command line is;
TFSDeleteProject /collection:http://yourTFSurl “project name”
Quotes for project name is necessary if our project name has spaces in between otherwise it can be ignored. That should take care of the project in TFS. Alternatively we can also try deleting the project with
tf destroy $/project name
In-spite of the above trials I had ghost project that showed up in Source Control explorer and it can be very misleading.
Here is what I did that removed my unused projects.
1.Mapped the broken project to a local folder
2.Deleted the project from TFS
3.Checked in the changes
The broken/unused projects are gone from TFS Source control explorer now.
The reason why the project was not deleted before could be that there were some files in the source controlled version of the project that were not fully deleted from the local folder in-spite of removing the mapping. Remapping the project brought the pending files and deleting the TFS project + check in took care of those corrupted files.
A good thread to follow on similar issue is http://social.msdn.microsoft.com/Forums/ta/tfsversioncontrol/thread/833e2f1b-03c3-4cab-a891-0efbd24768a3