π 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 defaultDebugis 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.