/warnaserror (C# Compiler Options)
Updated: July 20, 2015
For the latest documentation on Visual Studio 2017 RC, see Visual Studio 2017 RC Documentation.
The /warnaserror+ option treats all warnings as errors
/warnaserror[<U>+</U> | -][:warning-list]
Any messages that would ordinarily be reported as warnings are instead reported as errors, and the build process is halted (no output files are built).
By default, /warnaserror- is in effect, which causes warnings to not prevent the generation of an output file. /warnaserror, which is the same as /warnaserror+, causes warnings to be treated as errors.
Optionally, if you want only a few specific warnings to be treated as errors, you may specify a comma-separated list of warning numbers to treat as errors.
Open the project's Properties page.
Click the Build property page.
Modify the Treat Warnings As Errors property.
To set this compiler option programmatically, see TreatWarningsAsErrors.
in.cs and have the compiler display no warnings:
csc /warnaserror in.cs csc /warnaserror:642,649,652 in.cs