I am looking for syntax that will test an expression and throw an exception if the result is false AND the DEBUG
symbol is missing. But not when it is there.
I know I can use:
#if !DEBUG
Trace.Assert(condition);
#endif
And I know I can use:
#if !DEBUG
SomeGlobal.Production = true;
#endif
So I can write:
Trace.Assert(SomeGlobal.Production && condition);
to avoid having the compilation instructions in different places.
Any other way?