To suppress specific warnings for Visual C# or F#:
- In Solution Explorer, choose the project in which you want to suppress warnings.
- On the menu bar, choose View, Property Pages.
- Choose the Build page.
- In the Suppress warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons, and then rebuild the solution.
Check out here for more info on how to suppress specific warning for Visual C++ and Visual Basic.
Another ways is to use #pragma warning
can enable or disable certain warnings.:
#pragma warning disable warning-list
#pragma warning restore warning-list
warning-list
A comma-separated list of warning numbers. Enter the numbers alone, without the "CS" prefix. When no warning numbers are specified, disable disables all warnings and restore enables all warnings.