1

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 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

The file was moved to dotnet/sdk repo.
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."

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.