File Does Not Exist. System.IO.FileInfo GetFileInfo(System.String, System.String, System.Web.HttpResponse)

by rbellantoni 5/18/2012 5:25:00 AM

If you're getting this frustrating error in the application error event in the global.asax file and it looks like this:

 

12/12/2012 14:49:23
Type : System.Web.HttpException, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
Message : File does not exist.
Source : System.Web
Help link : 
ErrorCode : -2147467259
Data : System.Collections.ListDictionaryInternal
TargetSite : System.IO.FileInfo GetFileInfo(System.String, System.String, System.Web.HttpResponse)
Stack Trace :    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)

The cause of this is because there is a file missing somewhere either an image file or some other referenced file. Now normally this would not throw an error, but the issue seems to appear due to a bad AppRelative path. You check to see what file/image is missing by drilling down into System.Web.HttpContext.Current.Request and looking at the AppRelativeCurrentExecutionFilePath when inside of the application error event to find out what file is missing. There you will see the bad relative path as well as the file it's looking for. Normally it wouldn't throw an error by having a missing image or referenced file path, but because its a relative path and the property is server side it throws a server level error.

Tags:

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About the author

Name of author Author name
Something about me and what I do.

E-mail me Send mail

Calendar

<<  July 2018  >>
MoTuWeThFrSaSu
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

View posts in large calendar

Recent comments

Tags

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2018

Sign in