Editing Web.config programmatically

前端 未结 7 1302
半阙折子戏
半阙折子戏 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:13

    Yes I agree with Josh. I have tried this before and I've had two negative effects:

    1. Slow loading if the current page after postback because ASP.NET is loading the web.config and all related resources
    2. If you change the web.config early enough in the load cycle (e.g. global.asax events) the site may never load or fail in unpredictable ways

提交回复
热议问题