Skip to content

Instantly share code, notes, and snippets.

@ryuichi24
Last active June 23, 2021 09:40
Show Gist options
  • Save ryuichi24/8ecafd29deadb9872c4c467d37276d57 to your computer and use it in GitHub Desktop.
Save ryuichi24/8ecafd29deadb9872c4c467d37276d57 to your computer and use it in GitHub Desktop.
commands for dotnet cli

Dotnet Cli Commands

make a solution

dotnet new sln -n <solution name>

list project type names that can be created

dotnet new

make a project

dotnet new <project type name> -n <project name>

make a class library

dotnet new classlib -n <classlib name> -o <output path>

add a project to solution

dotnet sln <path to the solution file> add <path to the csproj file>

add all projects to solution

dotnet sln <path to the solution file> add **/*.csproj

remove a project from a solution

dotnet sln <path to the solution file> remove <path to the csproj file>

add a reference

dotnet add <path to the csproj file> reference <path to the target csproj file>

add a new package

dotnet add package <package name> --version <version>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment