/dotnet

Ultimate dotnet cli Cheat Sheet for developers

Hey command line fellas, are you a cmd person rather than 10 Clicks using GUI, then this is for you. The below list also helps me to work on large scale applications using just vscode.

Photo by Luke Chesser on Unsplash

dotnet new

  • dotnet new sln - Solution File
  • dotnet new console - Console Application
  • dotnet new classlib - Class library
  • dotnet new mvc - ASP.NET Core Web App
  • dotnet new xunit - XUnit test project
  • dotnet new l - Obtain complete list of available templates

dotnet sln

  • dotnet sln list - List all projects in a solution file
  • dotnet sln mySolution.sln add myProject/­myProject.c­sproj - Add a C# project to a solution
  • dotnet sln mySolution.sln remove myProject/­myProject.c­sproj - Add a C# project to a solution
  • dotnet sln todo.sln add **/*.cs­proj - Add multiple C# projects

dotnet sln

  • dotnet run - Run the project in the current directory
  • dotnet run --project ./proj­ect­s/helloWorld/helloWorld.c­sproj - Run the specified project
  • dotnet myapp.dll - Run a framew­ork­-de­pendent app named myapp.dll

dotnet clean

  • dotnet clean - Clean the output of a project
  • dotnet clean --conf­igu­ration Release - Clean a project built using the Release config­uration

dotnet publish

  • dotnet publish - Publish the project in the current directory
  • dotnet publish ~/proj­ect­s/myApp/myApp.c­sproj - Publish the applic­ation using the specified project file

dotnet pack

  • dotnet pack - Build the project and create NuGet packages
  • dotnet pack --no-build --output nupkgs - Pack the project but skip the build
  • dotnet pack /p:Pac­kag­eVe­rsi­on=­3.0.0 - Set the package version while pack
HariHaran

HariHaran

Full Stack Developer

Read More