When #if DEBUG runs

后端 未结 7 593
星月不相逢
星月不相逢 2020-12-14 06:03

I have this code in my C# class.

#if DEBUG
        private const string BASE_URL = \"http://www.a.com/\";
#else
        private const string BASE_URL = \"h         


        
相关标签:
7条回答
  • 2020-12-14 07:06

    When you compile with the DEBUG directive. So if it's set only the first line will be part of the compiled binary and if it's not set the second line will be part of the binary.

    The DEBUG is by default set when you are compiling the debug configuration in VS however you can set it manually for any configuration

    0 讨论(0)
提交回复
热议问题