Remove project from visual studio solution

Robert picture Robert · Jul 9, 2014 · Viewed 26.2k times · Source

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?

Answer

Pavlos Honderich picture Pavlos Honderich · Mar 27, 2015

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...