You can simply use the #if DEBUG directive like this
#if DEBUG //code here only executes in debug
So, if you need some code that works in DEBUG, and another that is in RELEASE, you do it like this:
#if DEBUG //code here only executes in debug #else //code here only executes in release #endif
And as DAKL explained, you can also use a conditional attribute.
Patrick klug
source share