I have some cs files in my project that are not set to be built (Properties -> Build Action = None). They contain bits of code that don't compile as a whole and are there merely for reference. I don't care about any compilation errors in them, but they appear in the "Error List" window. The errors don't stop compilation, merely clutter the window. Is there some way to tell VS to ignore errors in that file? Or in all files not set to be built, at that ?
I'm using VS 2010
Thanks
To reproduce this:
- Create a new C# project.
- Add a new .CS file to the project. Type some garbage in between the
class Class {
and the closing}
. - Don't build the project
- Note that the Error List window says something like "Invalid token '}' in class, struct, or interface member declaration".
- Set the Build Action for the .CS file to "None".
- Notice that the Error List still displays the error.