Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate Solution File From List of CSProj

I've got alot of projects and I don't have a master solution with everything in it. The reason I want one is for refactoring.

So I was wondering if anybody knew an automatic way to build a solution file. Manually adding all the projects just isn't feasible.

like image 634
Ryu Avatar asked Jan 05 '09 20:01

Ryu


People also ask

How do I create a solution file in Visual Studio code?

Open VS Code in a new folder. Open a new Terminal window. The shortcut for this is CTRL+SHIFT+'. Create a new file in the folder.

How do I create a solution to an existing project?

To create an empty solutionOn the menu bar, select File > New > Project. On the Create a new project page, type solution into the search box. Select the Blank Solution template, and then click Next. Enter Name and Location values for your solution, and then select Create.


2 Answers

In 2018, you can use dotnet sln command to add project to an existing solution and dotnet new sln to create a new one.

To add all projects from current folder use these commands in PowerShell

dotnet new sln
Get-ChildItem -Recurse *.csproj | ForEach { dotnet sln add $_.FullName }
like image 86
ulex Avatar answered Oct 08 '22 05:10

ulex


And I have now updated my utility (mentioned above) to support creation of solution folders: http://bloggingabout.net/blogs/vagif/archive/2009/12/03/utility-to-generate-solution-files-can-now-create-solution-folders.aspx

like image 32
Vagif Abilov Avatar answered Oct 08 '22 05:10

Vagif Abilov