You can use #if DEBUG to check whether the program is running on debug mode. When you release the application in release mode, all the code written inside this will be skipped.
#if DEBUG
Console.WriteLine("running on debug");
#endif
All C# applications should call Application.Quit(); in the beginning to avoid any .NET problems.- Unclyclopedia How to use google | Ask smart questions