Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HttpException occurred: File does not exist

I have a Silverlight/ASP hosted app. When I start, I get the error:

HttpException occurred

File does not exist.

This just started happening yesterday, and I have no idea why. It's not even getting to my code, just internal calls starting with WebHost.Host.ProcessRequest.

Running VS2010, the app is .NET 4.0

I would appreciate any help- I have real bugs to fix ASAP!

Cheers, Daniel

like image 245
Daniel Williams Avatar asked Dec 07 '25 12:12

Daniel Williams


2 Answers

Got it, and here's how:

Run the app and immediately get the error

Turned on Call Stack Window (Debug->Windows->Call Stack)

Top of the stack is a call to System.Web.StaticFileHandler.GetFileInfo

Went to Locals Window (Debug->Windows->Locals) did not see anything meaningful there

Went up the stack once to ProcessRequestInternal

Looked in Locals Window, opened up variable called "context" browsed through properties... in ConfigurationPath I see a path to a file: /ClientBin/Images/pclogo.png

Sure enough, that image file not there!

Copy the file, and all is well. Whew!

Next just need to fix the project by making sure the image is treated as content. Still, such a slog to find an obvious and common error.

like image 82
Daniel Williams Avatar answered Dec 10 '25 03:12

Daniel Williams


I fixed the issue by looking at Daniel Williams solution. In my case it was looking for faviicon.ico This is when I debug using Chrome.

like image 24
user696961 Avatar answered Dec 10 '25 03:12

user696961