vendredi 20 novembre 2015

Conditional Compile based on DEPLOYMENT profile

Conditional compile controls for Debug and Release are useful. But the same exists for Local vs Azure cloud based testing. IE based on what the target deployment is going to be

For example, On the Azure cloud, at startup I have to some code that runs at OnStart() because it is starting up on a bare bones image and the ResourceMessage file needs to be moved to the correct place based on what localization language we are running in.

However, that directory structure does not exist on my local development machine, and similarly my local development machine is NOT in the trusted AD domain of the Azure AD environment.

So I need a way for conditional compilation to occur when building for PROFILE == LOCAL vs PROFILE == CLOUD

when running Local, I want the OnStart() code to not be compiled/executed when running Cloud, I want the OnStart() code to be compiled/executed

Any thoughts?

Aucun commentaire:

Enregistrer un commentaire