Is switching app.config at runtime possible?

前端 未结 5 1027
庸人自扰
庸人自扰 2020-12-19 04:39

Is there a way at runtime to switch out an applications app.config (current.config to new.config, file for file). I have a backup/restore process which needs to replace its

5条回答
  •  不知归路
    2020-12-19 05:09

    Turns out I can swap the .config file for the new one and do a ConfigurationManager.RefreshSection(...) for each section. It will update from the new .config file.

提交回复
热议问题