Home > Articles > Programming > Windows Programming

  • Print
  • + Share This
Like this article? We recommend Suppressing Warnings

Suppressing Warnings

Sometimes it is necessary or useful to suppress warnings generated by the tools during compilation. This can be done using the SuppressMessage attribute, as shown in Listing 13.

Listing 13—Using the SuppressMessage Attribute

[SupressMessage("Microsoft.Contracts", "CC1055", 
   Justification="value is validated in BarCore")]
public override void Bar(string value)
{
   BarCore(value);
}
  • + Share This
  • 🔖 Save To Your Account