conditional compilation c#

C#
#if DEBUG
    Console.WriteLine("Debug version");
#endif

Source

Also in C#: