How to undo "Create directory for solution" in Visual Studio

projects-and-solutions, visual-studio

Solution

At the solution node of the Solution Explorer pane, select 'top menu -> file -> save soln as..'. Save the solution file in the same folder as your project (assuming that's what you want).

Close everything. Move the project folder out of the solution folder.

Worked for me before but if you hard coded some absolute paths in your code or referenced assemblies/projects, you might have to fix those after opening the solution in VS.

PS: Backup first before trying. :P

Problem

I have a c# project wrapped in a solution. When I created the project I wrongly ticked the "Create directory for solution" check-box. I would now like to relocate the .sln file to the same folder as the project. Problem is, if I just move it in (and change the project path inside with a text editor) I get all sorts of build errors when opening the solution. I have also tried creating a new solution and "adding an existing project", but this also causes similar build errors. Any suggestions how to handle this situation? Thanks!

Original source