#1,127 – Where to Find Compiler Warning Numbers

You can use #pragma warning to selectively disable certain warnings that occur when compiling your code.

The #pragma warning line requires knowing the specific warning number, which is not displayed in the list of warnings on the Error List tab.

1127-001

To find the warning number, you need to switch to the Output tab and look at the full text of the warning.  In the example below, we see that the warning about an event that is never used is warning #67.

1127-002

Once you know the warning number, you can use it with a #pragma warning.

#pragma warning disable 67
        public event EventHandler CanBarkChanged;
#pragma warning restore 67

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

One Response to #1,127 – Where to Find Compiler Warning Numbers

  1. Pingback: Dew Drop – June 27, 2014 (#1805) | Morning Dew

Leave a comment