Domanda

I am manually editing a Settings.StyleCop file to configure stylecop in VS2012. So far, I've had success suppressing many unwanted rules, but SA1504 won't go away. I'm using stylecop 4.6.

Here's a snippet of my settings file:

<StyleCopSettings Version="4.3">
   <Analyzer AnalyzerId="Microsoft.StyleCop.CSharp.LayoutRules">
      <Rules>
    <Rule Name="AllAccessorMustBeMultiLineOrSingleLine">
          <RuleSettings>
            <BooleanProperty Name="Enabled">False</BooleanProperty>
          </RuleSettings>
        </Rule>
      </Rules>
   </Analyzer>
</StyleCopSettings>

Note that the version in the file is 4.3, but changing it to 4.6 doesn't fix the problem and in fact makes all the rules in the file not work.

Can anyone explain the behavior I'm seeing and/or point me to documentation for a Settings.StyleCop file?

È stato utile?

Soluzione

Perhaps because the rule's name is "AllAccessor*s*MustBeMultiLineOrSingleLine"? (The StyleCop settings UI application should generate XML with the correct rule name if you're in any doubt.)

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top