【发布时间】:2015-07-15 10:17:54
【问题描述】:
如何更改 Azure Web 应用程序中的 applicationHost.config? 我试试:
using (ServerManager serverManager = new ServerManager())
{
Microsoft.Web.Administration.Configuration config = serverManager.GetApplicationHostConfiguration();
Microsoft.Web.Administration.ConfigurationSection webLimitsSection = config.GetSection("system.applicationHost/webLimits");
webLimitsSection["connectionTimeout"] = TimeSpan.Parse("00:00:10");
webLimitsSection["dynamicIdleThreshold"] = 150;
webLimitsSection["headerWaitTimeout"] = TimeSpan.Parse("00:00:10");
webLimitsSection["minBytesPerSecond"] = 500;
serverManager.CommitChanges();
}
但捕获异常:
文件名:\?\D:\Windows\system32\inetsrv\config\applicationHost.config 错误:权限不足,无法写入配置文件
【问题讨论】:
标签: c# azure azure-web-app-service web.config-transform