Back to results for “Project Structure”
.NET › .NET CLI, SDK & Project Structure (csproj)

What does the `dotnet watch` command do, and how does it speed up local development?

Beginner

Answer

`dotnet watch run` monitors source files for changes and automatically rebuilds and restarts (or hot-reloads, when possible) the application, eliminating the manual stop-edit-rebuild-restart cycle during active development. It supports Hot Reload for many code changes without a full restart, preserving application state where feasible.
dotnet watch run
# Edit a .cs file and save --
# the app automatically rebuilds and either hot-reloads or restarts
Real-world example A developer building an ASP.NET Core API uses `dotnet watch run` throughout the day, seeing most controller and service changes reflected within a couple of seconds without manually restarting the server.

Common follow-ups: What kinds of code changes support Hot Reload versus requiring a full restart?;How does dotnet watch differ from IDE-integrated hot reload?