Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9239273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T07:56:58+00:00 2026-06-18T07:56:58+00:00

I am trying to understand what error occurred that sent me to the Global

  • 0

I am trying to understand what error occurred that sent me to the Global ASAX OnError handler.

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;

      //get the last error
      Exception ex = context.Server.GetLastError();
      if(ex.InnerException.GetType().ToString() == "CSLA.DataPortalException")
        ex = ex.InnerException;

Here is my Exception converted to a 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 do I determine what line of code is causing this error? I tried to set my Debug options to break when the error occurs, but it didn’t , I still end up in the ONERROR global handler.

One thing is that I see that the code assumes that there will be an Inner Exception, and this appears to be NULL and is causing a second error within the handler.

I assume that the error is occuring somewhere in compiled code. I checked the Web.Config, and the only paths mentioned there is a Log Path, and that seems valid and logging appears to be working.

Update
I found some additional information here:

How to solve 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 search my entire solution looking for favicon.ico using “Find In Files” and I see no reference.

Why am I getting an error that the icon file is not found when I see no reference to it? I’m guess some assembly is using it? But why is it looking for it in the web root?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T07:56:59+00:00Added an answer on June 18, 2026 at 7:56 am

    The request for favicon.ico is being blindly made by most modern browsers and they are expecting a 404 (File Not Found) if there is no favicon (this is proper behaviour). Below you can find a quote from HTML5 working draft regarding Link type “icon”
    :

    In the absence of a link with the icon keyword, for documents obtained
    over HTTP or HTTPS, user agents may instead attempt to fetch and use
    an icon with the absolute URL obtained by resolving the URL
    /favicon.ico against the document’s address, as if the page had
    declared that icon using the icon keyword.

    The reason why you see the exception is that the web development server or IIS configured to use Managed/Integrated Pipeline Mode puts all requests through Global.asax (including errors).

    You can try to prevent the browsers from making the requests by creating following dummy link to favicon:

    <html>
        <head>
            <link rel="shortcut icon" href="#" />
            ...
        </head>
    ...
    </html>
    

    You also might try one of following:

    • Add following line at beginning of RegisterRoutes method:

      routes.IgnoreRoute("favicon.ico");

      or even more extended version:

      routes.IgnoreRoute("{*favicon}", new {favicon=@"(.*/)?favicon.ico(/.*)?"});

    • Create yourself an empty file for favicon
    • Filter out the errors by checking HttpException.GetHttpCode() for 404 and ((System.Web.HttpApplication)Sender).Context.Request.Url for /favicon.ico.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am novice to python and I am trying to understand a basic error
Hey i can't seem to understand this error. I'm trying to select an image
I am trying to understand how to use the new std::thread using Visual Studio
I'm learning Haskell and stuck trying to understand the type system. I'm trying to
I am trying to understand why I get the following error: Communication with server
I am trying to understand roundoff error for basic arithmetic operations in MATLAB and
I am receiving an error in the hosted app and am trying to understand
Now I'm trying to work with System.Web.Routing. All is just fine, but I can't
I am trying understand ViewModels deeper and I have read many articles and blogs
Trying to understand what's the correct way of implementing OpenID authentication with Spring Security.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.