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?
A compiler directive is interpreted at compile time and not at runtime. Therefore it does not matter, if the using application is compiled in RELEASE or DEBUG mode. Therefore
1.) library is compiled in DEBUG mode, application is compiled in RELEASE => Yes
2.) library is compiled in RELEASE, application is compiled in DEBUG => No