dotnet watch builds and runs a .NET application, monitors project files, and applies supported changes through hot reload. In ASP.NET Core development, it keeps the browser synchronized without repeatedly stopping the application and running dotnet run. section 4.3.1 section 4.6
A practical development loop looks like this:
- Run dotnet watch from the project directory; the command starts the application and can open a browser window. section 3.2.1 section 4.3.1
- Edit a view, HTML file, or other supported project file and save it; dotnet watch recompiles the project and reloads the browser. section 3.2.1 section 4.3.1
- Expect a restart prompt when an edit cannot be applied as hot reload; choose restart, or select Always when repeated unsupported edits are expected. section 4.3.1 section 21.1.2
- Use dotnet run instead when changing initial service or middleware configuration or routing, because those changes are not handled reliably by dotnet watch. section 23.1.1
Editing a view without restarting
In a PartyInvites ASP.NET Core project, run dotnet watch, open the application, and change Views/Home/Index.cshtml. The updated party message appears in the browser automatically. Similarly, changing wwwroot/demo.html triggers recompilation and a browser update. If changing a C# namespace produces “Unable to apply hot reload because of a rude edit,” restart the application. section 3.2.1 section 4.3.1
Listing 4.8 Starting the application with hot reload
dotnet watch
Shows the complete command used to start an ASP.NET Core application with hot reload. section 4.3.1

