Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

/nowarn (Suppress Specified Warnings)

/nowarn:number1[,number2[...]]

where:

number1, number2
A warning number that you want the compiler to suppress.

Remarks

The /nowarn option lets you suppress the compiler's ability to generate one or more warnings. Separate multiple warning numbers with a comma.

You only need to specify the numeric part of the warning identifier. For example, if you want to suppress CS0028, you could specify /nowarn:28.

The compiler will silently ignore warning numbers passed to /nowarn that were valid in previous releases, but that have been removed from the compiler. For example, CS0679 was valid in the compiler in Visual Studio .NET 2002 but was subsequently removed.

To set this compiler option in the Visual Studio development environment

  1. Open the Property Pages dialog box for the project. For details, see Setting Visual C# Project Properties.
  2. Click the Configuration Properties folder.
  3. Click the Build property page.
  4. Modify the Suppress specific warnings property.

To set this compiler option programmatically

See NoWarn.

See Also

C# Compiler Options

Show:
© 2015 Microsoft