Search code examples
c#stylecop

StyleCop ignoring settings


StyleCop (v4.4) has started ignoring my settings.

I have imported StyleCop targets in the project file like this:

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
  <Import Project="..\..\Tools\Microsoft\StyleCop\CurrentStyleCop.targets" />

I have a StyleCop.Settings file in the project directory, and when I edit it with the settings editor, it shows SA1640 unchecked, yet when I build I am still getting errors for SA1640.

I have tried removing the StyelCop.Settings, and relying on one in a higher directory, but can't get it to work.

It used to ignore SA1640 without any problems (this is one of the few rules I override to turn off).

Any ideas how I have broken it?


Solution

  • It turns out I was editing the settings file with the wrong version of the StyleCopSettingsEditor.

    Re-edited with version 4.4 and it all works again.