Asp.net "file not found" - no link to file!

I am working with asp.net (I am a developer) and at some point during debugging it will throw me and I get back to Exception objErr in the code and when I find it it says "file not found". I assume this is an image, but I have searched and cannot find to determine which file is missing. Hopefully this is enough information - if anyone can give me a direction I would greatly appreciate it!

AB

+1


source to share


5 answers


Find FileMon which is in Microsoft's SysInternals package and run it when you get close to a file problem, perhaps add a filter to filter out all OS file operations.

You will be able to see a file that was not found or access denied for a file if you configured it correctly.



I use FileMon all the time, it's free and really helps with troubleshooting file resolution and I / O issues.

Ryan

+1


source


I think you didn't give the full path for the image you are looking for.



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

0


source


Do you really have no information about which file was not found?

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

0


source


Take a look at the generated IIS log found in: C: \ WINDOWS \ system32 \ LogFiles \ W3SVC1 \ and look for 403 or similar.

0


source


When accessing a file within your project, always add " ~ " in front. This means that the path after the "~" sign refers to the root folder of the projects.

Example:
If an .Aspx file named "Example.asp" is 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>

      

Hope this helps a little.

0


source







All Articles