Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

change solution file to a different folder

How do I change the folder of my existing solution file (sln)?

It's right now inside one of my project's folder; if I cut the solution file and paste it in the root folder,it doesn't load any of my projects.

like image 710
Josh Avatar asked Jul 31 '10 11:07

Josh


People also ask

How do I move a solution to another folder in Visual Studio?

In Visual Studio, click Tools > Options. Expand Projects and Solutions and click Locations. The Projects location field defines the default location for storing new projects. You can change this path if you are using a different working folder.

How do you move a project from one solution to another?

In the Solution Explorer window, right-click and select Remove to remove a project from a solution. Right-click the solution (top node) and select Add > Existing Project to add a project to a solution. Thank you.

How do I add a folder to solution?

Creating Solution Folders To create a folder within the solution, right-click the solution name in the Solution Explorer pane and choose "Add", then "New Solution Folder" from the context-sensitive menu. To create a subfolder, start by right-clicking an existing solution folder and then choose the same menu options.

How do I move a project to another folder?

Click on the options menu (the vertical ellipsis) in the row and click Move. Click Browse to select the folder to which you want to move the project. Click Move.


2 Answers

Open solution explorer in Visual Studio and select the solution.
Click on File > Save MyProject.sln As ...
and choose the new location.

like image 171
Martin Avatar answered Sep 22 '22 04:09

Martin


The solution file is just a text file. You should be able to move it and then edit it to make sure that any relative paths referenced in the file are correct.

I've also been able to right-click on the solution file in the solution explorer and then use save-as to save it in a different location. That doesn't seem to work everytime for me though.

like image 23
RWGodfrey Avatar answered Sep 20 '22 04:09

RWGodfrey