I want to exclude /Properties/AssemblyInfo.cs from stylecop checking. Can we do that? the problem is that i have integrated stylecop with nant. In nant i am stamping product version so the information from Assembly info changes and it gives warning in nant email. I am using stylecopcmd for nant integration.
There are a couple of ways to do this. The recommended method is with file lists. Here is an example:
<StyleCopSettings Version="4.3">
<SourceFileList>
<SourceFile>AssemblyInfo.cs</SourceFile>
<Settings>
<GlobalSettings>
<BooleanProperty Name="RulesEnabledByDefault">False</BooleanProperty>
</GlobalSettings>
</Settings>
</SourceFileList>
</StyleCopSettings>
Alternatively you can use the ExcludeFromStyleCop
setting in the project file as documented here:
<Compile Include="AssemblyInfo.cs">
<ExcludeFromStyleCop>true</ExcludeFromStyleCop>
</Compile>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With