We have a number of config transforms which enable us to publish to a particular environment with the correct options specified in web.config.
However, it would be useful to run the application locally while specifying a particular build configuration. This would enable us to run the app locally and have it connected to the live database, for example - quite handy when tracking down bugs, for example.
However, when we press F5 to run the app locally, regardless of the build configuration currently selected, no transform of the web.config file appears to occur.
Is this the normal behaviour and is it possible to change it?
Reposted from comment:
Yes, it is the normal behaviour. It's a nuisance because it makes the whole thing feel half-a-job-ish and I agree there should be the option to opt-in for the same transformations being applied during a standard build. I haven't found any VS extensions that can do this for you yet, though I imagine it could be done. I personally make a ".Local" version of all my build configs and publish to a local IIS which I can attach to very quickly/easily if I want to use a diffferent environment/config's web.config. Requires some duplication, but does the job
Thanks David
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With