//DEBUG必须大写,其它是不认的 #if (DEBUG) Console.WriteLine("Debug"); #else Console.WriteLine("非Debug"); #endif 转载于:https://www.cnblogs.com/pnljs/p/3261416.html