【发布时间】:2009-06-15 21:31:01
【问题描述】:
好的,这似乎是一个非常简单的问题,但我似乎无法解决它。我几乎 99% 确定这是 Visual Studio 本身的问题,但我想快速检查一下。
我正在为 Asp.Net 中的健康监控创建自定义提供程序。我制作了一个非常简单的提供程序,它继承自 BufferedWebEventProvider。代码位于我网站的App_Code目录下,如下:
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
而web.config如下。
<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>
每当我尝试编译时,我都会收到此错误:
错误 2 无法加载类型“SQLApplicationExceptionProvider”。
路径\web.config 90
我考虑使用类型的全名(即使它不应该是必需的),但由于这是一个网站(而不是 Web 应用程序),我不确定该类型是什么。
【问题讨论】:
标签: asp.net .net vb.net configuration