Я ищу HttpExceptions в подпрограмме Application_Error моего global.asx
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
Dim ex As Exception = HttpContext.Current.Server.GetLastError()
If ex IsNot Nothing Then
If TypeOf (ex) Is HttpUnhandledException Then
If ex.InnerException Is Nothing Then
Server.Transfer("error.aspx", False)
End If
ex = ex.InnerException
End If
If TypeOf (ex) Is HttpException Then
Dim httpCode As Integer = CType(ex, HttpException).GetHttpCode()
If httpCode = 404 Then
Server.ClearError()
Server.Transfer("error_404.aspx", False)
End If
End If
End If
End Sub
Я могу пройти по этому коду и подтвердить, что он попадает в Server.Transfer («error_404.aspx»), а также в Page_Load error_404.aspx, но все, что он показывает, это пустая страница.