views:

293

answers:

6

Hi there - I'm working with asp.net (I'm a designer) and at some point during debugging it'll throw me and I'll get to an Exception objErr in the code - and when I hover it says "file not found". I assume it's an image but I've been searching and can't find anyway to pinpoint which file is missing. I hope this is enough information - if anyone could give me a direction I'll really appreciate it!

AB

A: 

I think you have not given full path for the image which you are searching.

Another problem which might be possible is when it throws an error check the page in your url and check if that page exists in your project. I wish I could help you more but I need more info for that,

Samiksha
A: 

Do you really have no information on which file is not found?

It is probably a misspelled filename (1 character typo's can be hard to find). So if you don't have the missing filename, debugging can be a real horror.

Gamecat
A: 

Take a look at the IIS log produced, Found at: C:\WINDOWS\system32\LogFiles\W3SVC1\ and search for a 403 or similar.

Drejc
A: 

When referencing a file inside your project always add a "~" in front. This means that the path after the "~" sign is relative to the projects root folder.

Example:
If an .Aspx file called "Example.asp" is located in the Pages folder inside the project you want to reference it as

<asp:HyperLink ID="lnkExample" runat="server" NavigateUrl="~/Pages/Example.aspx"> Example</asp:HyperLink>

I hope this helps a bit.

Germstorm
+1  A: 

Find FileMon which is in the SysInternals package from Microsoft and run it when you get near to your file issue, maybe add a filter to filter out all of the OS file operations.

You'll be able to see a file not found or access denied entry for the file if you have it set up right.

I use FileMon all the time, it is free and really helps when troubleshooting permission and file IO problems.

Ryan

Ryan ONeill
A: 

Ryan - thanks! I used filmon and found the missing image. I guess there really is no other way to track down the file (it was an image in a css file referenced from the masterpage - whew!)

Thanks again! AB