0

We are using style cop in VS2013 c# solution. 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. So adding the header doesn't help.

Is there a permanent solution to this problem?

Thanks!

OBL
  • 1,347
  • 10
  • 24
  • 45
  • Do the generated files have a consistent file name? If so, you should be able to use the StyleCop.settings file to exclude the file based on a regex. http://stylecop.codeplex.com/discussions/394180 – ne1410s Apr 08 '14 at 20:12

1 Answers1

2

Try adding this to your Settings.StyleCop file:

<Parsers>
  <Parser ParserId="StyleCop.CSharp.CsParser">
    <ParserSettings>
      <CollectionProperty Name="GeneratedFileFilters">
        <Value>\\TemporaryGeneratedFile_.+\.cs$</Value>
      </CollectionProperty>
    </ParserSettings>
  </Parser>
</Parsers> 
Martin Costello
  • 9,672
  • 5
  • 60
  • 72
  • Remember that the contents of the element is a regular expression that is used to match the file names of your generated files. – ne1410s Apr 08 '14 at 20:21