Reputation:
I have 2 different projects in 1 solution but the .sln file is in one of these projects. I want the .sln file to be above them. You will understand better when you see images.
The ss of my solution explorer:
Here you can see there are 2 projects in 1 solution. Also the name of solution and one of my projects is the same here.
Here is the place .sln file is located:
I want this .sln file to be located in here above them:
How do I do that? Thank you, have a nice day
Upvotes: 1
Views: 2993
Reputation: 1583
If you have existing solution with projects I think the easiest way would be to select File -> Save *.sln as and select the location you need.
Visual studio will automatically update paths to projects.
I had something like this in the old solution
Project("{FAE04... "ConsoleApp7\ConsoleApp7.csproj", "{E0C7925E..."
The new one has
Project("{FAE04... "ConsoleApp7\ConsoleApp7\ConsoleApp7.csproj", "{E0C7925E..."
Checked for VS 2017 and 2019.
P.S. The solution should be selected in the Solution Explorer, else the "Save *sln as" item doesn't appear(it will suggest to save something else).
Upvotes: 6
Reputation: 25628
The sln file is relatively easy to edit in any text editor.
Close Visual Studio, move the solution to where you want it, then open the solution file in a text editor. Change the references to the proj files so that the relative path is included.
Here is an example from one of mine:
In this case, each of the proj files is in a subfolder and the sln file is in the root directory.
Upvotes: 0