Is there any way to find out if an assembly has been compiled with the TRACE or DEBUG flag set without modifying the assembly?
How to Programmatically Detect if an Assembly is Compiled in Debug or Release mode from Scott Hanselman.