StyleCop SA1636 规则在不应触发时触发

发布于 2024-08-10 18:45:29 字数 257 浏览 10 评论 0原文

我们使用 Resharper 4.5 和 StyleCop 4.3。

我们有一个包含许多 .CS 文件的项目。所有 .CS 文件都具有由我们的 StyleCop 设置定义的有效标头,并由 Resharper 的插入/替换标头操作自动添加。

其中四个 .CS 文件收到 SA1636 警告。版权文本与设置文件中声明的版权文本完全匹配。

还有其他人遇到过这个问题吗?我们是否可以启用或以其他方式使用任何类型的诊断日志记录来帮助确定为什么这一规则似乎未触发?

We are using Resharper 4.5 and StyleCop 4.3.

We have a project with many .CS files in it. All .CS files have valid headers, as defined by our StyleCop settings, and added automatically by Resharper's Insert/replace header action.

Four of the .CS files receive a SA1636 warning. The copyright text exactly matches the declared copyright text from the settings file.

Has anyone else experienced this problem? Is there any kind of diagnostic logging that we can enable or otherwise use to help determine why this one rule appears to be mis-firing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

你与昨日 2024-08-17 18:45:29

使用记事本或 Visual Studio 另存为等工具检查编码格式 - 我的编码使用了错误的字符集。

Check the encoding format using something like notepad or visual studio Save As - mine was encoding with the wrong character set.

娜些时光,永不杰束 2024-08-17 18:45:29

如果 @Adrian 的答案对您不起作用,这个答案将:

  1. 右键单击 StyleCop.json
  2. 单击“属性”
  3. 将构建操作更改为“C# 分析器附加文件”:

选择 C# 分析器附加文件而不是无

彼得·莫里恩:https://blog.submain.com/stylecop-detailed-guide/< /a>

In case @Adrian's answer didn't work for you, this one will:

  1. Right click over StyleCop.json
  2. Click on Properties
  3. Change the build action to 'C# analyser additional file':

Choose C# analyzer additional file instead of None

Credits to Peter Morlion: https://blog.submain.com/stylecop-detailed-guide/

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文