Asp.net 处理应用程序内部异常\u Error global.asax

Asp.net 处理应用程序内部异常\u Error global.asax,asp.net,global-asax,application-error,Asp.net,Global Asax,Application Error,我在全局文件中编写了关于应用程序\u错误的代码 我正在数据库中插入错误详细信息。 但有时它会插入上千条相同错误的记录。 这是否意味着应用程序\u error中存在错误 如果是,我该如何处理。 编辑1 插入错误后,我还会重定向到错误页面 错误细节 Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.<br><br><br> Inner Exception : Sys

我在全局文件中编写了关于
应用程序\u错误的代码

我正在数据库中插入错误详细信息。
但有时它会插入上千条相同错误的记录。
这是否意味着
应用程序\u error

中存在错误 如果是,我该如何处理。

编辑1 插入错误后,我还会重定向到错误页面

错误细节

Message: Exception of type 'System.Web.HttpUnhandledException' was thrown.<br><br><br>
Inner Exception : System.NullReferenceException: Object reference not set to an instance of an object.

at System.Collections.Specialized.NameObjectCollectionBase.BaseGetKey(Int32 index)
at System.Collections.Specialized.NameObjectCollectionBase.BaseRemove(String name)
at System.Web.SessionState.SessionStateItemCollection.Remove(String name)
at InfoDomeWeb.UserControl.LeftPanel.SetCustomerInfo() in D:\Working Folder\InfoDome\InfoDomeWeb\UserControl\LeftPanel.ascx.cs:line 185
at InfoDomeWeb.UserControl.LeftPanel.Page_Load(Object sender, EventArgs e) in D:\Working Folder\InfoDome\InfoDomeWeb\UserControl\LeftPanel.ascx.cs:line 71
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)<br><br><br>Stack trace:    at System.Web.UI.Page.HandleError(Exception e)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.error_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\root\961a93aa\98c42fe5\App_Web_304di5zu.12.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

但是我没有发现任何错误。

您是否可以至少共享全局错误代码以及多次记录的错误?您是否发现此错误发生在本地开发计算机和部署服务器上?还是本地罚款\
D:\Working Folder\InfoDome\InfoDomeWeb\UserControl\LeftPanel.ascx.cs