dotnet add reference to sln code example
Example 1: dotnet core sloution
dotnet new sln --name my-solution
dotnet new [type] --name my-project
dotnet sln add my-project/my-project.csproj
dotnet sln list
dotnet restore
dotnet build my-solution.sln
Example 2: how to add project to solution command line
$ dotnet sln add "src\CliApp\CliApp.csproj"
Project `src\CliApp\CliApp.csproj` added to the solution.