开发者

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 enab开发者_Python百科le 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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜