Does any one of you know a way I'd be able to suppress e.g. CA2000 for an entire solution?
I'm thinking of something like a GlobalSuppressions
class with the following line of code:
[assembly: SuppressMessage("Microsoft.Reliability", "CA2000:DisposeObjectsBeforeLosingScope")]
Thanks for your help in advance.
If you migrate a project to Visual Studio 2019, you might suddenly be faced with a large number of code analysis warnings. If you aren't ready to fix the warnings, you can suppress all of them by selecting Analyze > Build and Suppress Active Issues.
Suppress specific warnings for Visual C# or F# Or, select the project node and press Alt+Enter. Choose Build, and go to the Errors and warnings subsection. In the Suppress warnings or Suppress specific warnings box, specify the error codes of the warnings that you want to suppress, separated by semicolons.
Learn how to compare and revise your contacts and segments against the Global suppression list. The Global suppression list (GSL) is a collection of known bad email addresses and domains, including ISP spam complainants.
Turn off the warning for a project in Visual StudioSelect the Configuration Properties > C/C++ > Advanced property page. Edit the Disable Specific Warnings property to add 4996 . Choose OK to apply your changes.
Global Suppressions can be configured in .editorconfig file.
root = true
in first line[*.{cs,vb}]
dotnet_diagnostic.<Rule_Code>.severity=silent
Here is an example .editorconfig file
root = true
[*.{cs,vb}]
dotnet_diagnostic.CA2000.severity=silent
[*.{cs,vb}]
dotnet_diagnostic.MA0004.severity=silent # Even works with 3rd part rules/analyser
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With