I am trying to understand what happened with the error that sent me to the OnArror global handler for ASAX.
using System; using System.Web; namespace GLSS.Components.HttpModules { public class ExceptionModule : System.Web.IHttpModule { private void OnError(object sender, EventArgs e) { HttpContext context = HttpContext.Current;
Here is my exception converted to string
HttpContext.Current.Server.GetLastError().Message "File does not exist." HttpContext.Current.Server.GetLastError().StackTrace " at System.Web.StaticFileHandler.GetFileInfo(String virtualPathWithPathInfo, String physicalPath, HttpResponse response) at System.Web.StaticFileHandler.ProcessRequestInternal(HttpContext context) at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)"
How to determine which line of code is causing this error? I tried to disable Debug options when an error occurred, but it is not, I still ended up in the global ONERROR handler.
It's one thing that I see that the code assumes that there will be an Internal exception, and it looks like NULL and causes a second error in the handler.
I assume that the error occurs somewhere in the compiled code. I checked Web.Config and the only paths mentioned here are the path to the log and it seems valid and the logging works.
Update I found additional information here:
How to solve the exception "File does not exist"?
When I check this in the Immediate window:
? HttpContext.Current.Request.Url.ToString() "http://localhost:2322/favicon.ico"
However, what puzzles me is that I'm looking for all of my solution looking for favicon.ico using "Find Files" and I don't see the link.
Why am I getting an error that the icon file was not found when I cannot see the link to it? I assume the assembly uses it? But why is he looking for it in the root web server?
Chadd
source share