TreatWarningsAsErrors

The build property that turns every compiler and analyzer warning into an error, so code with warnings fails to build.

In more detail

It stops warnings accumulating unnoticed and makes the quality bar part of the build contract. Set it once in Directory.Build.props.

Example

<TreatWarningsAsErrors>true</TreatWarningsAsErrors>

Related terms

Taught in

References