System.webServer具有无效的子元素'monitoring'
问题描述:
我正在使用Visual Studio 2015和本地IIS Express和Azure Web应用程序。System.webServer具有无效的子元素'monitoring'
我正在尝试使用这些说明来实现Worker流程回收。
https://azure.microsoft.com/en-us/blog/auto-healing-windows-azure-web-sites/
然而,当我尝试实施<monitoring>
和<trigger>
我得到的错误
元素“system.webServer具有无效子元素“监控”
答
这可能是一个只有Azure功能,所以我建议您将其添加到转换文件中。即web.autoheal.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.webServer>
<monitoring xdt:Transform="Insert">
<triggers>
<!-- Scenario #1: Recycling based on Request Count -->
<requests count="1000" timeInterval="00:10:00"/>
<!-- Scenario #2: Recycling based on slow requests -->
<slowRequests timeTaken="00:00:45" count="20" timeInterval="00:02:00" />
<!-- Scenario #3: Logging an event (or recycling) based on HTTP status code(s) -->
<statusCode>
<add statusCode="500" subStatusCode="100" win32StatusCode="0" count="10" timeInterval="00:00:30"/>
</statusCode>
<!-- Scenario #4: Taking custom actions (or recycling/logging) based on memory limit -->
<memory privateBytesInKB="800000"/>
</triggers>
<!-- Scenario #1 & #2 Action -->
<actions value="Recycle"/>
<!-- Scenario #3 Action -->
<actions value="LogEvent"/>
<!-- Scenario #4 Action -->
<actions value="CustomAction">
<customAction exe="d:\home\procdump.exe" parameters="-accepteula w3wp d:\home\w3wp_PID_%1%_" />
</actions>
</monitoring>
</system.webServer>
</configuration>
由于它是一个Azure唯一的功能,我假设我可以忽略警告无效的子元素'监测',正确的? –
是的,你可以。在发布之前使用此xdt转换。 – EvertonMc
当然,编辑它以涵盖您的要求。我在这里发现了一些技巧https://channel9.msdn.com/Series/Windows-Azure-Web-Sites-Tutorials/Auto-Haling-an-Azure-App-Service – EvertonMc