How to relocate my solution (.sln) file to a different location

Viewed 26

I need to relocate my solution file to the root folder, I tried to do it in Visual studio from File-> Save .sln As, but it doesn't let me to change the location. Appreciate any advise for this.

1 Answers

Just move it there by hand (using the explorer). Make sure you have closed Visual Studio first. Then open the solution file in a text editor and change the relative path of the project(s) within it. You will see a section of the form

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SoDSAPI", "So.DS.API.csproj", "{94DBA414-3A51-47AB-A91E-92475B86AF9A}"
EndProject

The second parameter ("So.DS.API.csproj") is the relative path from the solution to the project. It probably doesn't include a folder for you, since you had the solution and the project in the same folder before. Change that to include the project folder, so the value changes to "So.DS.API\So.DS.API.csproj". Save the file and then start VS again.

Related