问题
I want to disable this style cop rule
SP1516: Adjacent elements must be separated by a blank line.
How do I do that? What do I write in Settings.StyleCop
?
回答1:
The following blog entry by Microsoft StyleCop gives you instructions on how to disable individual rules - Enabling or Disabling StyleCop Rules
- Right Click Project -> Source Analysis Settings
- Click on the 'Rules' tab
- Navigate to the particular rule you want to disable and uncheck it.
- Click OK!
回答2:
You can disable it in Settings.StyleCop like this:
<StyleCopSettings Version="105">
<Analyzers>
<Analyzer AnalyzerId="StyleCop.CSharp.LayoutRules">
<Rules>
<Rule Name="ElementsMustBeSeparatedByBlankLine">
<RuleSettings>
<BooleanProperty Name="Enabled">False</BooleanProperty>
</RuleSettings>
</Rule>
</Rules>
</Analyzer>
</Analyzers>
</StyleCopSettings>
来源:https://stackoverflow.com/questions/16958321/how-to-disable-rule-sp1516-in-settings-stylecop