Dotnet watch

From Logic Wiki
Jump to: navigation, search


dotnet-watch is a file watcher for dotnet that restarts the specified application when changes in the source code are detected.

How to Install

Install tools by editing your *.csproj file and adding a DotNetCliToolReference with the package name and version.

 <ItemGroup>
   <DotNetCliToolReference Include="Microsoft.DotNet.Watcher.Tools" Version="1.0.0" />
 </ItemGroup>
dotnet restore
# Execute tools
dotnet watch

How To Use

The command must be executed in the directory that contains the project to be watched.

Usage:

dotnet watch [options] [[--] <args>...]

Options:

 -?|-h|--help  Show help information
 -q|--quiet    Suppresses all output except warnings and errors
 -v|--verbose  Show verbose output

Add watch after dotnet and before the command arguments that you want to run:


What you want to run Dotnet watch command
dotnet run dotnet watch run
dotnet run --arg1 value1 dotnet watch run --arg1 value
dotnet test dotnet watch test
dotnet run --framework net451 -- --arg1 value1 dotnet watch run --framework net451 -- --arg1 value1