Docs

.NET CLI

The dotnet CLI for building and running.

Projects

dotnet new webapi -o Api
Scaffold a project
dotnet new sln
Create a solution
dotnet sln add Api
Add project to solution
dotnet add package Serilog
Add a NuGet package
dotnet add reference ../Lib
Add a project reference

Build & run

dotnet restore
Restore packages
dotnet build -c Release
Build
dotnet run
Run the project
dotnet watch
Run with hot reload
dotnet test
Run tests
dotnet publish -c Release -o out
Publish

EF Core

dotnet ef migrations add Init
Create a migration
dotnet ef database update
Apply migrations
dotnet tool install -g dotnet-ef
Install the EF tool