I'm writing an application that must get certain values passed in via environment variables. (Yeah, I know about app.config, but the customer requires I integrate the app into a workflow where they use batch files to set environment variables.)
When debugging, these variables of course are not set, so I hardcode them. I can forsee myself forgetting to comment-out these lines. Is there a compiler directive to conditionally compile code segments? I can see that through the Configuration Manager, there is a "debug" environment. Can that be used to say "if (debug)"?
Or, is there a better way to manage this situation?
Thomas D. Greer
When debugging, these variables of course are not set, so I hardcode them. I can forsee myself forgetting to comment-out these lines. Is there a compiler directive to conditionally compile code segments? I can see that through the Configuration Manager, there is a "debug" environment. Can that be used to say "if (debug)"?
Or, is there a better way to manage this situation?
Thomas D. Greer