.NET and ASP.NET Core 10 cheatsheet

.NET and ASP.NET Core 10: Build, run and test

8 common .NET and ASP.NET Core 10 tasks.

Restore dependencies

Download the NuGet packages a project needs.

dotnet restore

Build the project

Compile the project or solution.

dotnet build

Run the project

Build the project if needed and run it.

dotnet run --project src/MyApi

Run with hot reload

Rebuild and restart when source files change.

dotnet watch

Run the tests

Run the tests in a project or solution.

dotnet test

Run matching tests

Run only tests whose fully qualified name contains the text.

dotnet test --filter "FullyQualifiedName~Login"

Format the code

Apply code style rules to the project.

dotnet format

Clean build output

Delete the bin and obj outputs of a build.

dotnet clean

Was this page helpful?