How to save configurations into web.config file?
问题 I'm using a Asp.net dynamic web site application and can't save configurations into web.config file. I have tried something like this, but doesn't work! var configuration = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); configuration.AppSettings.Settings["Value"].Value = "Some value"; configuration.Save(); Error I have got with 1. OpenWebConfiguration(Server.MapPath(".")) & OpenWebConfiguration(Server.MapPath("~"): The relative virtual path 'C:/...' is not allowed