Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Languages / C#

Conditional compilation using #if#endif block

4.00/5 (2 votes)
25 Aug 2010CPOL 8.6K  
If you need to include different environment variables between production and dev by making use of the #if DEBUG #endif block

public void main()
{
Console.WriteLine("Release code");

#if Debug

Console.WriteLine("Debug code");

#endif
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)