简体   繁体   English

样式Cop自动生成的代码

[英]Style Cop Auto Generated code

We are using style cop in VS2013 c# solution. 我们在VS2013 c#解决方案中使用样式警察。 I am running in to a specific scenario where the auto generated code files don't have the // tag as the header. 我正在运行一个特定的场景,其中自动生成的代码文件没有//标签作为标头。 These are the files I have in the integration test project for Workflow designer files, with code - behind auto generated files, they are re-created during the build process every single time. 这些是我在Workflow设计器文件的集成测试项目中拥有的文件,其中包含代码隐藏自动生成的文件,它们在构建过程中每次都重新创建。 So adding the header doesn't help. 因此添加标题无济于事。

Is there a permanent solution to this problem? 有这个问题的永久解决方案吗?

Thanks! 谢谢!

Try adding this to your Settings.StyleCop file: 尝试将此添加到您的Settings.StyleCop文件:

<Parsers>
  <Parser ParserId="StyleCop.CSharp.CsParser">
    <ParserSettings>
      <CollectionProperty Name="GeneratedFileFilters">
        <Value>\\TemporaryGeneratedFile_.+\.cs$</Value>
      </CollectionProperty>
    </ParserSettings>
  </Parser>
</Parsers> 

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

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