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.
Pro ASP.NET Core 7, Tenth Editiondotnet watch is a .NET command-line tool that monitors source files and reruns or rebuilds an application when changes occur.
dotnet runalternative to · dotnet run is a .NET CLI command that builds and runs an application from its project.
viewuses · A view is a presentation component or template that renders application data into a user-interface element or client response.
code reloadinguses · Code reloading is a development technique that detects changed code or resources and refreshes, reevaluates, or restarts affected application components without requiring a full manual restart.
Razor Pagesuses · Razor Pages is an ASP.NET Core page-focused programming model in which independently addressable pages combine Razor markup with request-handling logic.
browseruses · A web browser is software that retrieves, interprets, and renders web resources, executes supported web content, and enables interaction with web pages and applications.
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.