dotnet / dotnet/sdk

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

Open
#51,497 0 comments 0 reactions 0 assignees View on GitHub
Area-CLI untriaged
Dominant language
C#
Stars
3.2k
Forks
1.3k
PR merge metrics
PR metrics pending

Description

### 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:

```powershell

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;

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

Or even in a powershell environment something like:
```powershell
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.