【发布时间】:2012-03-20 00:59:53
【问题描述】:
我正在使用 Log4Net 并在每次我的 ASP.NET 应用程序抛出错误时进行日志记录:
protected void Application_Error(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
Log.Error("An error occurred", ex);
}
唉,每次我访问我的应用程序的页面时,都会捕获 System.Web.HttpException,“文件不存在”。
这是堆栈跟踪:
bei System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response)
bei System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context, String overrideVirtualPath)
bei System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
bei System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
bei System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
我不知道如何调试它,这发生在我的 ASP.NET 开发服务器和我部署的 IIS 7.5 上。
【问题讨论】:
标签: c# asp.net exception log4net application-error