从StyleCop分析中排除文件:标签被忽略 [英] Exclude file from StyleCop analysis: "auto-generated" tag is ignored

查看:191
本文介绍了从StyleCop分析中排除文件:标签被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#文件的开头,我添加了:

At the beginning of a C# file, I have added:

//-----------------------------------------------------------------------
// <copyright company="SomeCompany" file="MyFile.cs">
// Copyright © Some Company, 2011
// </copyright>
// <auto-generated />
//-----------------------------------------------------------------------

我希望StyleCop跳过对这个文件的检查,所以我使用了

I want StyleCop to skip checking this file, so I used the auto-generated trick explained in other answers.

但是,在清洁并重建我的解决方案之后,StyleCop会继续为此文件生成警告.为什么会这样?怎么解决?

However, after cleaning and rebuilding my solution, StyleCop keeps generating warnings for this file. Why does this happen? How can it be fixed?

我正在使用Microsoft Visual Studio 2008专业版和StyleCop v4.3.

I am using Microsoft Visual Studio 2008 Professional Edition and StyleCop v4.3.

推荐答案

@Frédéric-不幸的是,Analyze generated files选项与以<auto-generated />标签跳过文件无关.

@Frédéric - unfortunately, Analyze generated files option is not somehow connected with skipping files with <auto-generated /> tag.

无论设置值如何,始终会跳过包含<auto-generated />文本的文件.

Files containing <auto-generated /> text will always be skipped regardless the value of the setting.

@Daniel-我相信您已经处理了4.3版的错误,该错误已于一年多以前发布,现在肯定已经过时了.仅当您使用Visual Studio 2005时才使用4.3,这是StyleCop 4.4所不支持的.

@Daniel - I believe that you deal with a bug in version 4.3 which was released more than a year ago and is definitely obsolete now. The only reason to use 4.3 is only if you use Visual Studio 2005, which is not supported by StyleCop 4.4.

我强烈建议您升级到4.4-我刚刚检查了您的示例,它运行正常.

I strongly recommend you upgrading to 4.4 - I've just checked your example and it works fine.

这篇关于从StyleCop分析中排除文件:标签被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆