Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asp.net config transforms - don't apply for normal builds, only publish

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?

like image 408
David Avatar asked Jul 01 '11 13:07

David


1 Answers

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

like image 54
Smudge202 Avatar answered Nov 11 '22 15:11

Smudge202