如何查看返回 500 内部错误的页面中的完整错误?
我看到的只是错误号和描述-内部服务器错误-没有错误详细信息的确切细节?
检查错误日志。它们的位置取决于您的服务器设置。
如果错误发生在您的 ASP.NET 应用程序上,您可以捕获错误并将其通过电子邮件发送给自己。
您可以在 Global.asax 文件中捕获错误...
Sub Application_Error(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when an unhandled error occurs
Dim sb As New StringBuilder
sb.AppendFormat("Page Location: {0}", Context.Request.RawUrl)
With Server.GetLastError.GetBaseException
sb.AppendFormat("Message: {0}", .Message)
sb.AppendFormat("Source: {0}", .Source)
sb.AppendFormat("Method: {0}", .TargetSite)
sb.AppendFormat("Stack Trace: {0}", .StackTrace)
End With
Dim ErrorMsg As String = sb.ToString()
' Post thee error to a logger...
End Sub
G。