Ignoring generated files when using "Treat warnings as errors"

Posted by krystan honour on Stack Overflow See other posts from Stack Overflow or by krystan honour
Published on 2010-04-30T08:44:45Z Indexed on 2010/04/30 8:57 UTC
Read the original article Hit count: 222

We have started a new project but also have this problem for an existing project. The problem is that when we compile with a warning level of 4 we also want to switch on

'Treat all warnings as errors'

We are unable to do this at the moment because generated files (in particular reference.cs files) are missing things like XML comments and this generates a warning, we do not want to suppress the xml comment warnings totally out of all files just for specific types of files (namely generated code).

I have thought of a way this could be achieved but am not sure if these are the best way to do this or indeed where to start :) My thinking is that we need to do something with T4 templates for the code that is generated such that it does fill in XML documentation for generated code.

Does anyone have any ideas, currently I'm at well over 2k warnings (its a big project) :(

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about visual-studio-2010