我知道这是非常基本的,但你试过吗?这在Web.config文件中。
<customErrors mode="On" defaultRedirect="Error.aspx">
</customErrors>
另外,我有时放在Application_Error事件下面的代码在全局文件记录异常:
' Fires when an error occurs
' Code that runs when an unhandled error occurs
Dim ErrorDescription As String = Server.GetLastError.ToString
' Log the Error to Event Log
'Creation of event log if it does not exist
Dim EventLogName As String
EventLogName = ConfigurationManager.AppSettings("ApplicationLog").ToString()
If (Not EventLog.SourceExists(EventLogName)) Then
EventLog.CreateEventSource(EventLogName, EventLogName)
End If
' Inserting into event log
Dim Log As New EventLog()
Log.Source = EventLogName
Log.WriteEntry(ErrorDescription, EventLogEntryType.Error)
你跟这个有现在的问题是什么?成员和角色提供者仍然在IIS7中工作。 – Xoltar
是的,他们这样做。我的问题是,虽然似乎有整个Http错误(例如401到500)的规定和设置自定义错误的能力。事实上,提供一个非静态的,主页面驱动的错误页面(可在Cassini上运行)似乎证明使用IIS7和集成模式进行配置似乎是“不可能的”。 – brumScouse
编辑表示没有什么是不可能的 – brumScouse