简体   繁体   English

StyleCop忽略设置

[英]StyleCop ignoring settings

StyleCop (v4.4) has started ignoring my settings. StyleCop(v4.4)已经开始忽略我的设置。

I have imported StyleCop targets in the project file like this: 我在项目文件中导入了StyleCop目标,如下所示:

  <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. 我在项目目录中有一个StyleCop.Settings文件,当我使用设置编辑器编辑它时,它显示SA1640未经检查,但是当我构建时,我仍然收到SA1640的错误。

I have tried removing the StyelCop.Settings, and relying on one in a higher directory, but can't get it to work. 我已经尝试删除StyelCop.Settings,并依赖于更高目录中的一个,但无法使其工作。

It used to ignore SA1640 without any problems (this is one of the few rules I override to turn off). 它曾经没有任何问题地忽略SA1640(这是我为了关闭而重写的少数规则之一)。

Any ideas how I have broken it? 我是怎么打破它的?

It turns out I was editing the settings file with the wrong version of the StyleCopSettingsEditor. 事实证明我正在使用错误版本的StyleCopSettingsEditor编辑设置文件。

Re-edited with version 4.4 and it all works again. 使用4.4版重新编辑,它再次有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM