.net-core

.NET Core: How to create solution folders from the command line


I am organising a new project, and I would like to create as much of it as possible from the command line.

I like to put my test projects into a solution folder. However, the command dotnet sln add seems somewhat restricted. Its argument list seems to consist only of a list of project files to add.

Is there a way of specifying a solution folder (as opposed to a physical folder) when adding newly created projects (test projects in my case, but the question is more general)?


Solution

  • At the moment it is not possible, you need create the physical structure folder like the solution structure folders

    dotnet new <typeproj> --output "physical/domain" --name "domain"
    
    dotnet new <typeproj> --output "physical/service" --name "service"
    

    after open the solution with visual studio, create the "physical" solution folder and add the previous projects that you already have ready