문제

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