You need preprocessor directives or conditional compilations. You can read about them here .
An example from this link:
#define TEST using System; public class MyClass { public static void Main() { #if (TEST) Console.WriteLine("TEST is defined"); #else Console.WriteLine("TEST is not defined"); #endif } }
Code is compiled only if TEST is defined at the top of the code. Many developers use #define DEBUG, so they can enable code debugging and delete it again by simply changing one line at the top.
Nibblypig
source share