.net核心Web应用程序中无法监视web.config中的触发器

时间:2019-04-17 08:55:28

标签: azure .net-core web-config

我正在尝试在.NET Core Web应用程序的web.config文件中实现一项设置(请参见下文)。 Web应用程序托管在Azure中。 该设置位于system.webServer部分,并应根据以下文章在响应缓慢时重新启动工作进程: https://azure.microsoft.com/sv-se/blog/auto-healing-windows-azure-web-sites/

<monitoring>
 <triggers>
  <slowRequests timeTaken="00:01:00" count="10" timeInterVal="00:02:00" />
 </triggers>
</monitoring>

但是在使用此设置发布配置文件时,Web应用程序崩溃并显示错误消息:

HTTP错误500.19-内部服务器错误

  • 工作进程无法读取applicationhost.config或web.config文件。
  • 无法访问请求的页面,因为该页面的相关配置数据无效。

有人在Azure托管的.net核心应用中成功实现了此设置吗?

1 个答案:

答案 0 :(得分:0)

我发现缺少一个设置。完整的监视标签应为:

  <monitoring>
    <triggers>
      <slowRequests timeTaken="00:01:00" count="10" timeInterval="00:02:00" />
    </triggers>
    <actions value="Recycle" />
  </monitoring>