How to programatically detect if you are running Visual Studio in Debug mode
The DEBUG global boolean allows you to programatically detect if you are running Visual Studio in Debug mode.
You can use it in the special #if block. An example appears below.
string myString = "I am running Visual Studio in release mode";
#if(DEBUG)
myString = "Actually I am running Visual Studio in debug mode";
#endif
See also