#if DEBUG directive in compiled class library
问题 I am going to use #if DEBUG directive in a class library. The compiled ClassLibrary.dll will be used in a separate Application.exe. Will my debug code from this class library be executed in the following situations? library is compiled in DEBUG mode, application is compiled in RELEASE library is compiled in RELEASE, application is compiled in DEBUG 回答1: A compiler directive is interpreted at compile time and not at runtime. Therefore it does not matter, if the using application is compiled in