Is switching app.config at runtime possible?

前端 未结 5 1025
庸人自扰
庸人自扰 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 04:49

    I don't think it is possible at all to switch the configuration at runtime without restarting, so if you can't apply Jon's approach, you should try to come up with an other approach.

    Anyway, maybe it's just me not having enough information about your scenario, but this kind of feels fishy.

    Are you sure that swapping the configuration file is the best way to achieve whatever requirement you need to meet? I mean, this is quite an uncommon thing. If I were you, I would try to come up with some other approach.

提交回复
热议问题