build integration incorrectly flagging SA1633 on empty files.

Sep 17, 2012 at 7:32 AM


During the build of my project, with code contracts and code analysis on there are several completely empty files generated by the build. I think code contracts might use them, they are not included in the project tree, so I am not sure what they are used for.

Warning    3    SA1633 : CSharp.Documentation : The file has no header, the header Xml is invalid, or the header is not located at the top of the file. \obj\Check In\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

When I open the file it is completely empty. Is there a way of getting stylecop to ignore the file?

Sep 17, 2012 at 7:38 AM
Edited Oct 6, 2012 at 3:10 PM
Generated files are identified by regular expressions in the settings file. Add a reg ex to that to match your files.

Oct 6, 2012 at 5:15 AM

Thanks, this is all sorted now, I added the necessary regex.

May 29, 2014 at 1:31 PM
Why is StyleCop checking a file that is not part of the project? I have the check on both Designer files and Generated files disabled.