Search code examples
stylecop

Suppress stylecop file header warning message


we use StyleCop and it checks whether each source file has our copyright header. This is fine till I add an opensource file with its own header, and the two now are conflicting. How can I turn off Stylecop check for particular files and messagetypes in project?


Solution

  • If you want StyleCop to completely ignore these files, you can add ExcludeFromStyleCop elements within your .csproj file as described at http://stylecop.codeplex.com/wikipage?title=Using%20StyleCop%20on%20Legacy%20Projects.

    If you want to deactivate only certain rules for these files, this can be done by adding a SourceFileList section to your StyleCop.settings files as described at http://stylecop.codeplex.com/wikipage?title=Using%20File%20Lists.