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?

有帮助吗?

解决方案

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.)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top