【问题标题】:web.config <system.webServer> errorweb.config <system.webServer> 错误
【发布时间】:2015-11-06 07:56:30
【问题描述】:

VS 2015、.Net Framework 4.5.1、本地 IISExpress 和 Azure Web App

正在尝试遵循来自:https://azure.microsoft.com/en-us/blog/auto-healing-windows-azure-web-sites/ 的自我修复配置设置

错误:元素“system.webServer”具有无效的子元素“监控”

无论是在 VS2015 中本地运行还是部署到 azure Web 应用程序时,该应用程序都会编译但在运行时失败。

【问题讨论】:

标签: web-config monitoring self-healing


【解决方案1】:

我通过转换 Web.Release.config 文件解决了这个问题,例如:

<system.webServer>
<monitoring xdt:Transform="Insert">
    <triggers>
        <statusCode>
            <add statusCode="500" count="10" timeInterval="00:00:30" />
        </statusCode>
    </triggers>
</monitoring>
</system.webServer>

【讨论】:

    【解决方案2】:

    我还尝试在我的 Web 应用程序中包含此自动修复功能,并且在我的 web.config 中包含此功能并在本地运行时,我也遇到了内部服务器错误。

      <system.webServer>
        ...
        <monitoring>
          <triggers>
            <slowRequests timeTaken="00:00:30" count="5" timeInterval="00:10:00" />
          </triggers>
          <actions value="Recycle" />
        </monitoring>
      </system.webServer>
    

    但是在我的 azure 出版物中,我修改了 web.config(使用 kudu)并重新启动了我的网络应用程序,没有出现任何错误。

    我的是标准应用服务计划

    目前我还没有验证这个触发器是否有效果

    希望这会有所帮助!

    【讨论】:

      猜你喜欢
      • 2015-02-05
      • 2011-07-07
      • 2012-03-06
      • 2011-10-28
      • 2017-07-30
      • 2013-11-10
      • 2011-01-31
      • 2010-11-07
      • 1970-01-01
      相关资源
      最近更新 更多