How do you handle multiple web.config files for multiple environments?

后端 未结 9 1156
野趣味
野趣味 2020-12-08 01:04

The way I currently handle this is by having multiple config files such as:

web.config
web.Prod.config
web.QA.config
web.Dev.config

When th

9条回答
  •  情歌与酒
    2020-12-08 01:20

    We have a few workarounds (not all of them are done with web.config but the same idea)

    1. We include multiple configuration files in the packaged deployment. During installation we specify environment that we are installing on.
    2. Migrate all environment specific settings to the Database server for that environment. WebServer provides its environment when requesting server name
    3. Provide multiple settings (1 per environment) and using code request different settings.
    4. Combination of 2 and 3 (Override a part of the settings based on the environment - for example application server name)

提交回复
热议问题