To learn more about how to use C # preprocessor directives selectively to compile code segments, see #define (C # Reference) and #if (C # Reference) .
#define (C # Reference)
Address: https: //docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-define
#if (C # Reference)
Address: https: //docs.microsoft.com/zh-cn/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-if
We need to learn this knowledge.
Article: C # preprocessor directive
Record Time: 20,190,917
--------------------
Change the code will only run in debug mode
#if DEBUG Console.WriteLine("Debug version"); #endif