Reputation: 137544
How to suppress Style Cop rule SP0100?
Enumeration item name v2007 doesn't conform the specified style: SampleName, Sample_Name.
I tried following https://stackoverflow.com/a/3296152/284795
[SuppressMessage("SP0100")]
But I get an error
'System.Diagnostics.CodeAnalysis.SuppressMessageAttribute' does not contain a constructor that takes 1 arguments
Upvotes: 2
Views: 2069
Reputation: 16796
Are you sure that you have the index of the name right?
ElementsMustBeOrderedByAccess seems to be rule SA1202
EDIT:
OK, so it seems you are using a StyleCop+ rule - meaning that it is a bit of a pain to find the appropriate suppression data.
I have found the information for the ID in the source XML file for the rules, and, if I understand correctly, the category should be set to the full name of the class that exposes the rule, which is StyleCopPlus.StyleCopPlusRules
.
Meaning that the minimal attribute declaration, in your case, would be:
[SuppressMessage("StyleCopPlus.StyleCopPlusRules","SP0100:AdvancedNamingRules")]
Upvotes: 8