I am trying to suppress Style Cope warning for SA1300 by this line of code.
[SuppressMessage("StyleCop.CSharp.NamingRules","SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Reviewed.")]
It is working at class level (i.e. if I put it in class which has warnings then its work) but not working if I put it in GlobalSuppressions.cs class. I want to suppress SA1300 warnings for whole assembly so I put this line in GlobalSuppressions.cs but it’s not working.
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules","SA1300:ElementMustBeginWithUpperCaseLetter", MessageId = "Ctl", Scope = "namespace", Target = "Assembly name"))]
Is it possible to do it in "GlobalSuppressions.cs"? it is also not working for "SA1600"
I just had this same issue so thought I would give you my result.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.StyleCop.CSharp.NamingRules", "SA1300:ElementMustBeginWithUpperCaseLetter", Justification = "Auto generated name")]
I noticed your StyleCop namespace is not fully qualified. Should be "Microsoft.StyleCop.CSharp.NamingRules"
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