Is it possible to add a class to a project in Visual Studio and have that class only built for the Debug configuration of the project? That is, it will not appear in the Rel
Classes are easy:
#if DEBUG
// Put your class here
#endif
Not sure about resources though... I suspect it's feasible by editing the project file by hand, but not in Visual Studio.
I wouldn't do this for test purposes though - I'd encourage you to use a separate assembly for tests. Aside from anything else, that means you can test what you ship, by testing against the release build. If you need access to internal types/members, you can always use [InternalsVisibleTo] to grant internal access from your production assembly to your test assembly. Indeed, I suspect that's the most common use of the attribute :)