每次我的 ASP.NET-Application 抛出错误时,我都在使用 Log4Net 并进行日志记录:
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 上。