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

(C#) Determining whether the current build mode is Debug or Release

3.85/5 (5 votes)
29 Jan 2012CPOL 19.4K  
You can make it a bit shorter: public virtual bool IsDebug { get { #if (DEBUG) return true; #else return false; #endif } }Thanks for sharing,
You can make it a bit shorter:
C#
public virtual bool IsDebug
{
    get {
    #if (DEBUG)
        return true;
    #else
        return false;
    #endif
    }
}



Thanks for sharing,

License

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