web-config – web.config错误

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’具有无效的子元素’monitoring’

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

最佳答案 我通过转换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>
点赞