I have a WPF application with three custom configurations. The are as follows:
- Debug
- Deploy_Local
- Deploy_Beta
- Deploy_Live
Obviously I can use a precompiler directive to detect Debug:
#if DEBUG
// Debug code
#else
// Non-debug code
#endif
How can I do this with the the remaining three configurations?
I believe this was answered somewhat in: Will #if RELEASE work like #if DEBUG does in C#?
Basically, you do need to also define custom symbols at the project level (in the build tab). So if you name your configuration
MY_CONFIG, you will have to add theMY_CONFIGsymbol to all the project that you want to handle that configuration specifically. You can then do the same construct as:Hope this helps,
Eric.