Suppress Warnings By Using the SuppressMessage Attribute


This article applies to Visual Studio 2015. If you're looking for the latest Visual Studio documentation, use the version selector at the top left. We recommend upgrading to Visual Studio 2019. Download it here

It is often useful to indicate that the warning is nonapplicable to let team members know that the code was reviewed and it was determined that the warning should be suppressed. In Source Suppression (ISS) lets a developer to put the attribute that suppresses a warning close to the location that generated the warning. You can add the ISS attribute directly to the source file or you can use the shortcut menu in the Visual Studio IDE.

In This Section

In Source Suppression Overview Learn about ISS and how to use it in your code.
How to: Suppress Warnings by Using the Menu Item Learn how to suppress warnings in the Visual Studio IDE by using the shortcut menu.

Analyzing Managed Code Quality