Here is the simple solutions to check the .Net C# application is running in debug / Release mode.
#if(DEBUG)
Statments with in this block will be compiled & Executed in DEBUG mode;
#else
Statments with in this block will be compiled & Executed in Release mode;