Creating a solution file and adding projects in it

Using the .NET Core CLI, you can also create a solution file and add/remove projects in it. To create a default solution file, enter the following command in the console window:

    dotnet new sln

This will create a solution file named DotNetCore.sln in the current directory, as shown in the following screenshot:

In case you want to specify a name while creating the solution file, enter the command as follows:

    dotnet new sln -n "Demo Solution"  

The solution file, with the specified name, will get generated in the same folder:

To modify the solution file from the command line to add projects ...

Get Mastering Visual Studio 2017 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.