Okay, this seems like a very simple issue, but I can't seem to get around it. I am almost 99% sure that this is an issue of Visual Studio itself, but I want to have a quick sanity check.
I am creating a custom provider for Health Monitoring in Asp.Net. I have made a very simple provider that inherits from the BufferedWebEventProvider. The code is located in the App_Code directory of my website and is as follows:
Public Class SQLApplicationExceptionProvider
Inherits System.Web.Management.BufferedWebEventProvider
Public Overrides Sub Initialize(ByVal name As String, ByVal config As System.Collections.Specialized.NameValueCollection)
MyBase.Initialize(name, config)
End Sub
Public Overrides Sub ProcessEvent(ByVal eventRaised As System.Web.Management.WebBaseEvent)
MyBase.ProcessEvent(eventRaised)
End Sub
Public Overrides Sub ProcessEventFlush(ByVal flushInfo As System.Web.Management.WebEventBufferFlushInfo)
End Sub
Public Overrides Sub Shutdown()
Me.Flush()
End Sub
End Class
And the web.config is as follows.
<healthMonitoring enabled="true" heartbeatInterval="100" >
<providers>
<add name="DBSExceptionProvider" type="SQLApplicationExceptionProvider" buffer="true" bufferMode="RegularNotification" />
</providers>
<rules>
<add name="DBSErrors" eventName="All Errors" provider="DBSExceptionProvider" profile="Critical" />
</rules>
<bufferModes>
<add name="RegularNotification"
maxBufferSize="10"
maxFlushSize="5"
urgentFlushThreshold="2"
regularFlushInterval="Infinite"
urgentFlushInterval="00:00:30" />
</bufferModes>
<profiles>
<add name="Default" minInstances="1" maxLimit="Infinite" minInterval="00:01:00" />
<add name="Critical" minInstances="1" maxLimit="Infinite" minInterval="00:00:00" />
</profiles>
</healthMonitoring>
Whenever I try to compile, I get this error:
Error 2 Could not load type 'SQLApplicationExceptionProvider'. Path\web.config 90
For the life of me, I cannot understand why it does not compile. I considered using the full name of the Type (even though it should not be required) but since this is a WebSite (and not a web application) I am not sure what that type would be.
Any suggestions?