What MSBuild property is set when dotnet-watch is used?

782 Views Asked by At

When running dotnet watch or dotnet watch test, is there a way to know inside of the csproj file that it's running in a watch mode so certain features can be turned on or off?

1

There are 1 best solutions below

2
On

The MSBuild property DotNetWatchBuild will be set to true when MSBuild is invoked by dotnet-watch. Here's some more details on the tool.