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 Answer
The MSBuild property DotNetWatchBuild will be set to true when MSBuild is invoked by dotnet-watch. Here's some more details on the tool.
2 Comments
Jan Joneš
The file was moved to
dotnet/sdk repo.Bouke
This is only for the design-time build, not for the actual build: > "dotnet-watch performs a design-time build to find items to watch. When this build is run, dotnet-watch will set the property
DotNetWatchBuild=true."