Editing Web.config programmatically

前端 未结 7 1307
半阙折子戏
半阙折子戏 2020-12-03 21:57

What is a good way to edit a Web.config file programmatically?

I looked into System.Xml but couldn\'t find any obvious answers.

7条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-03 22:20

    In theory; you could just generate a web config file programmatically and with some templating to make it easy.

    However, if you're trying to edit your web.config from within the site; it's highly recommended you don't. At the very least; you'd trigger an app reset every time you updated it; which would be especially bad if you're using in-process sessions.

    As Anders asked, what is it you're trying to do?

提交回复
热议问题