Search code examples
c#c-preprocessorpragma

List of #pragma warning disable codes and what they mean


The syntax for disabling warnings is as follows:

#pragma warning disable 414, 3021

Or, expressed more generally:

#pragma warning disable [CSV list of numeric codes]

Is there a list of these numeric codes and the description of the warning that they're suppressing? Much to my chagrin, I can't seem to locate it via Google.


Solution

  • You shouldn't need a list. The compiler will tell you. If you get a compiler error that says "warning CS0168", then add 168 to the list (or, better yet, fix the code).