liveBook · Manning

Dotnet watch

As explained in .NET in Action, Second Edition

dotnet watch is a .NET command-line tool that monitors source files and reruns or reloads an application when changes occur.

dotnet watch is a .NET CLI command that monitors project files and automatically recompiles and reruns an application when source changes occur. It shortens the development loop for ASP.NET Core services by removing repeated manual restarts. section 3.1.1

Use dotnet watch to:

  • Replace the cycle of stopping the application, saving changes, and running dotnet run again. section 3.1.1
  • Keep an ASP.NET Core application running while editing its source files. section 3.1.1
  • Test endpoint changes more quickly during requests, filtering, paging, and error-handling work. section 3.1.1

Start an application in watch mode

Run `dotnet watch run` from the project directory instead of `dotnet run`. The command watches for file changes, recompiles the project, and runs the updated application automatically. section 3.1.1

How .NET in Action, Second Edition covers it

How deep it goes
Defines the command and its recompilation-and-rerun behavior, but does not detail configuration, reload boundaries, or internals.
Examples
Uses dotnet watch run while testing an ASP.NET Core endpoint and changing its source files.
What it assumes
Assumes terminal use and enough web-server knowledge to follow ASP.NET Core examples.
What you can do after
Apply it via the .NET CLI to recompile and rerun an application after source changes.
How it connects
Connects the .NET CLI with dotnet run, ASP.NET Core development, and hot reload.

Also explained in

Compare how 2 books explain dotnet watch →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET in Action, Second Edition. The section links point to the parts of the book it draws on.