title: Making problem in Health Mornitoring of asp.net
body: <p>I created a File Cleanup Provider that is inherits system.web.management.webeventprovider.</p>
  
  <pre><code>Public Class FileCleanupProvider
      Inherits System.Web.Management.WebEventProvider
  
      Private Const StateFIleFolderPath As String = "StateData/"
  
  
      Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)
          MyBase.Initialize(name, config)
      End Sub
  
  
      Public Overrides Sub Flush()
          ' not required
      End Sub
  
  
      Public Overrides Sub ProcessEvent(ByVal raisedEvent As System.Web.Management.WebBaseEvent)
  
          Dim DateTimeRaised As DateTime = raisedEvent.EventTime
          ' Remove files
          Dim FilePath As String = IO.Path.Combine(HttpRuntime.AppDomainAppPath, StateFIleFolderPath)
          For Each FileName In IO.Directory.GetFiles(FilePath)
              If (DateTimeRaised - IO.File.GetCreationTime(FileName)) &gt; TimeSpan.FromHours(6) Then
                  IO.File.Delete(FileName)
              End If
          Next
  
      End Sub
  
  
      Public Overrides Sub ShutDown()
          'Clean up on shut down
          Dim FilePath As String = IO.Path.Combine(HttpRuntime.AppDomainAppPath, StateFIleFolderPath)
          For Each FileName In IO.Directory.GetFiles(FilePath)
              IO.File.Delete(FileName)
          Next
      End Sub
  
  End Class
  </code></pre>
  
  <p>And I configure in web.config this</p>
  
  <pre><code>&lt;healthMonitoring enabled="true" heartbeatInterval="5"&gt;
        &lt;providers&gt;
          &lt;add name="FileCleanupProvider" type="System.Web.Management.WebEventProvider"/&gt;
        &lt;/providers&gt;
        &lt;profiles&gt;
          &lt;remove name="Default"/&gt;
          &lt;add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" custom=""/&gt;
        &lt;/profiles&gt;
        &lt;eventMappings&gt;
          &lt;remove name="Heartbeats"/&gt;
          &lt;add name="Heartbeats" type="System.Web.Management.WebHeartbeatEvent,System.Web,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" startEventCode="0" endEventCode="2147483647" /&gt;
        &lt;/eventMappings&gt;
        &lt;!--&lt;eventMappings&gt;
          &lt;add name="FileCleanupEvent" type="System.Web.Management.WebHeartbeatEvent" startEventCode="0" endEventCode="2147483647"/&gt;
        &lt;/eventMappings&gt;--&gt;
        &lt;rules&gt;
          &lt;clear/&gt;
          &lt;add name="FileCleanupRule" eventName="Heartbeats" provider="FileCleanupProvider" profile="Default"/&gt;
        &lt;/rules&gt;
      &lt;/healthMonitoring&gt;
  </code></pre>
  
  <p>But I got one problem that.</p>
  
  <p><img src="https://i.stack.imgur.com/ZO1Sh.png" alt="enter image description here"></p>
  
  <p>How can I solve that?</p>