Remove project from visual studio solution

30,111

Solution 1

I stumbled on this today as well. After scouring the options I succeeded by:

1) Unloading the project I wanted to remove

2) Right-clicking the project and selecting "Remove"

I can't fathom why MS removed the Remove option but I can only assume it had to do with the UI 'refactor' in 2012. I wonder if there's a hotkey in the 'loaded' state to avoid having to first unload the project...

Not to rant about the VS IDE context menus but IMHO it's still far too cluttered. While I'm not a fan of submenus they're drastically needed in this case. This is compounded by my biggest complaint which is that the relative order and even hierarchy of options across contexts can be drastically different for the same options. While I can understand the options themselves would need to be different and therefore have varying priority in the given context if you're going to share options between two contexts have them in at least close relative proximity. The best example is for 'Source Control' in VS2013. From the file editor context it's at the bottom of the list but from the solution contexts it's in the middle and has some SC options in the top menu rather than the submenu. Since many are not as likely to perform SC ops from the file editor (though I do a lot) move it to the bottom of the list so it matches the relative location from the solution context.

Anyway enough of my rant...

Solution 2

Remove should just remove it from the solution file. if it still wants to delete it, undo the pending delete against the project but commit the solution file change. this should leave the project file under source but remove it from the solution

Share:
30,111
Robert
Author by

Robert

Updated on July 05, 2022

Comments

  • Robert
    Robert almost 2 years

    In Visual Studio 2012 and TFS, how do I remove a project from a solution without adding a "delete of csproj file" to pending change list. I do simply want to remove the reference from this solution, but the project should still exist since its used in other solutions. If I simply delete it from the solution and then commit the change, then it will remove the csproj file!

    What is the proper way to remove a project from a solution without TFS removing the csproj file?

  • Robert
    Robert almost 10 years
    But unfortunately its not possible to easily "undo" the change. Since it will find the file on disk. So I will need to manually make a copy of the file on disk to somewhere else, and then delete it. Click undo. It will download a copy from the server, and then I need to replace this version with my local copy (if I have made changes I want to keep). This is how I can solve it. But I hope their is a better way?
  • Just TFS
    Just TFS almost 10 years
    no sorry you have lost me. to REMOVE a project from the solution, right click remove, check in the .sln file only. if you wish to make changes to this project, that is a different question. The project will still exist locally it just will no longer appear in solution explorer when you open the solution