Overview
dotnet watch is a file watcher. If the application supports hot reload, this command hot reloads the application whenever a code change is detected. If not, it restarts the application.
dotnet watchcan run any command dispatched via thedotnetexecutable. If you can rundotnet COMMAND, you can rundotnet watch COMMAND.- While
dotnet watchis running, you can force a restart from the shell with Ctrl+R. - Arguments passed after
--are sent to the childdotnetprocess. If runningdotnet watch run, these arguments are options fordotnet run.
options
--list— list all discovered files--no-hot-reload— watch, but do not hot reload on change--non-interactive— prevent console input from being requested
files watched by default
All items in the Compile, EmbeddedResource, and Watch groups of the project file that match these glob patterns:
**/*.cs*.csproj**/*.resxwwwroot/**
To add or remove watched files:
SomeProject.csproj
<ItemGroup>
<Watch Include="**\*.js"
Exclude="bin\**\*" />
</ItemGroup>