Is it possible to suppress CodeAnalysis messages in VS 2019 .editorconfig
? These two options don't work:
[*.cs]
#Trying alternatives to
#[System.Diagnostics.CodeAnalysis.SuppressMessage("Design", "CA1051:Do not declare visible instance fields", Justification = "<Pending>")]
dotnet_diagnostic.CA1051.severity = silent
dotnet_analyzer_diagnostic.CA1051.severity = silent
Yes, rule severity is configurable in an EditorConfig file in Visual Studio 2019 version 16.3 or newer (MSDN).
To suppress a rule violation, you should set the severity to none
:
dotnet_diagnostic.CA1051.severity = none
This worked for me after I edited the config file and restarted Visual Studio.
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