65.9K
CodeProject is changing. Read more.
Home

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

starIconstarIconstarIcon
emptyStarIcon
starIcon
emptyStarIcon

3.85/5 (5 votes)

Jan 30, 2012

CPOL
viewsIcon

19351

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:
    public virtual bool IsDebug
    {
        get {
        #if (DEBUG)
            return true;
        #else
            return false;
        #endif
        }
    }
Thanks for sharing,