Disable all stylecop warnings for a specific C# class

D J picture D J · Feb 8, 2013 · Viewed 14.3k times · Source

I am working in an application and developing few classes for demo purpose. I know that these classes will be removed in future.

Is it possible to ignore all the stylecop warnings for those classes as I dont want to spent the time on those warnings?

I searched but found that I can only ignore via settings in stylecop( this will effect other classes too) or to some specific rule ( I just want to ignore all warnings).

Answer

Jon picture Jon · Feb 8, 2013

You can trick StyleCop into not processing a file at all by adding this header at the top:

//------------------------------------------------------------------------------
// <auto-generated>
// Well, not really. This is just a trick to get StyleCop off my back.
// </auto-generated>
//------------------------------------------------------------------------------