Skip to main content
πŸ“œ WAYPOINT LESSON

The dotnet CLI verbs

⭐ beginner⏳ 13 min readπŸ“ Lesson 71 of 85

new, build, run, test, publish β€” five verbs cover the daily loop of a console developer.

The daily loop

dotnet new console -o MyApp    # scaffold a console project
cd MyApp
dotnet run                     # compile + execute
dotnet build                   # compile without running
dotnet test                    # run the test project(s)
dotnet publish -c Release      # ship-ready output

dotnet run is the edit–compile–execute loop; it rebuilds changed files and starts the program. build stops before running β€” use it to check compilation in CI. Outputs land in bin/ (executables) and obj/ (intermediate files); both are safe to delete and rebuilt on the next build β€” they're never committed.

Flags worth knowing early

  • -c Release β€” optimized build (the default Debug is slower but debugger-friendly).
  • --no-restore β€” skip package re-fetch when you know nothing changed.
  • -o β€” target directory when scaffolding.

The CLI is scriptable β€” everything a GUI does, these verbs do, which is exactly what the sandbox grading uses.