Skip to content

Can we add a project to a solution on creation in the CLI in a single command #51497

@grimley517

Description

@grimley517

Is your feature request related to a problem? Please describe.

Not a problem but an efficiency.

When I add a new project to a solution using the command line I have to write something like this:

dotnet add classlib -n libname -o libfolder
dotnet sln add libfolder/classlib.csproj

This is a bit cumbersome. particularly when I'm generally doing this in the solution folder, where the solution is anyway.

Describe the solution you'd like

I'd prefer to be able to do both things in a single command. Something like this;

dotnet add classlib -n libname -o libfolder --solution .

Or even in a powershell environment something like:

dotnet add classlib -n libname -o libfolder | dotnet sln add

Additional context

Am using the CLI in a powershell terminal on a Mac. Fully aware that powershell may not be the shell language of preference for many. Those using visual studio would just get this functionality after as many point and clicks as it takes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions