Visual Studio warning level meanings?

Jon Tackabury picture Jon Tackabury · Mar 13, 2009 · Viewed 50.7k times · Source

On the build tab in a Web Application project I have a setting called "Warning Level". I can set a value from 0 to 4. What do these values mean? Will a value of 0 be more strict and generate more warnings, or vice versa? I haven't been able to find any documentation on it yet, but perhaps I'm looking in the wrong place.

Answer

mwigdahl picture mwigdahl · Mar 13, 2009

This link shows you the definitions of the warning levels (I'm assuming you are using C# code in your web project). Level 4 is the most strict.


  • 0: Turns off emission of all warning messages.
  • 1: Displays severe warning messages.
  • 2: Displays level 1 warnings plus certain, less-severe warnings, such as warnings about hiding class members.
  • 3: Displays level 2 warnings plus certain, less-severe warnings, such as warnings about expressions that always evaluate to true or false.
  • 4: Displays all level 3 warnings plus informational warnings. This is the default warning level at the command line.