StaticFileHandler error

I am using VS 2010

What are some possible reasons I might be getting the following error?

How can I find out what is causing it...which file is missing / being sought for?


System.Web.HttpException: File does not exist. 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)
LVL 5
Tom KnowltonWeb developerAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Bob LearnedCommented:
Needle in a haystack...

Are you using custom HTTP file handlers?  Is there a section like this in the web.config?

<httpHandlers>
      <add verb="GET" path="ab*.jpg" type="WebLib.JPGHTTPHandler,WebLib"></add>
      <add verb="GET" path="*.jpg" type="System.Web.StaticFileHandler"></add>
</httpHandlers>

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Tom KnowltonWeb developerAuthor Commented:
This ended-up helping me:

http://dotbert.loedeman.nl/httpexception-file-does-not-exist

Specifically:

   if (((HttpApplication)sender).Context.Request.Url != null)
        {
            filen = ((HttpApplication)sender).Context.Request.Url.ToString();
        }


Here is the method inside Global.asax:



void Application_Error(object sender, EventArgs e)
    {

        string host = System.Configuration.ConfigurationManager.AppSettings["SMTP_SERVER"] as string;
        string erremailaddy = System.Configuration.ConfigurationManager.AppSettings["ERROREMAIL"] as string;
        string smtpusername = System.Configuration.ConfigurationManager.AppSettings["SMTP_USERNAME"] as string;
        string smtppassword = System.Configuration.ConfigurationManager.AppSettings["SMTP_PASSWORD"] as string;
        string storename = System.Configuration.ConfigurationManager.AppSettings["StoreName"] as string;
        string dbtype = System.Configuration.ConfigurationManager.AppSettings["DBTYPE"] as string;
        Exception err = Server.GetLastError();

        System.Net.Mail.SmtpClient smpt = new System.Net.Mail.SmtpClient();
        smpt.UseDefaultCredentials = false;
        smpt.Credentials = new System.Net.NetworkCredential(smtpusername, smtppassword);
        System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();


        string filen = "none";
        
        if (((HttpApplication)sender).Context.Request.Url != null)
        {
            filen = ((HttpApplication)sender).Context.Request.Url.ToString();
        }

        
        string errhead = null;
        try
        {
            errhead = err.InnerException.Message;
        }
        catch (Exception)
        { }
        string errbody = err.ToString();

        errhead = errhead + " -- FILENAME IS:  " + filen;
        
        msg.Body = "<b><h1>" + errhead + "</h1></b><br><br>" + errbody;
        smpt.Host = host;
        msg.IsBodyHtml = true;
        msg.From = new System.Net.Mail.MailAddress("error@iwebsoftware.com", "IWEB ERROR");
        msg.Subject = "IWEB ERROR AT " + storename;
        msg.To.Add(erremailaddy);

        smpt.Send(msg);




    }

Open in new window

Tom KnowltonWeb developerAuthor Commented:
thx
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.