Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

I get error that the file does not exists, but it does.

Posted on 2008-10-23
8
835 Views
Last Modified: 2012-05-05
Hello

I get this error every once and a while. The errors come in bulks. For example I get 10-15 errors in 5 seconds, then the error disappear and may not come back for a couple of days.

---
Error Message: The file '/mypage.ashx' does not exist.
Stack Trace:    at System.Web.UI.Util.CheckVirtualFileExists(VirtualPath virtualPath)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile)
   at System.Web.UI.SimpleHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath)
   at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig)
   at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
-----

---
0
Comment
Question by:Brimba
  • 4
  • 3
8 Comments
 
LVL 4

Author Comment

by:Brimba
ID: 22793765
There were no recycling or application restart during the period of the errors.
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22794148
'/mypage.ashx is that the file name ascx or aspx?

I have several times met this kind of issues, it just the IIS or VS setting screw up for some reasons. Especially when you render the usercontrol dynamically, and when you refer to the non-dot net oriented path. (let say dot net prefers this ~/folder/name.aspx, if you goes: ../folder/name.aspx then it doesn't like much.

This shouldn't happen after you publish your websites. Normally I close everything stop dot net development (laid on the system tray when you debug).

I agree this is odd.

JINN
0
 
LVL 4

Author Comment

by:Brimba
ID: 22794394
mypage.ashx is a httphandler.

I have this in web.config
<httpHandlers>
<add path="mypage.ashx" verb="POST,GET" type="myHttpHandlers.Merger, myHttpHandlers"/>
</httpHandlers>

So, in fact the error is correct in that way, the file does not exist. But since we have this httphandler configured in web.config asp.net should never respond saying that the file doesn't exist.

0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22794535
Well that's weird

machine.config
<httpHandlers>
 <add verb="*" path="*.aspx" type="System.Web.UI.PageHandlerFactory"/>
 <add verb="*" path="*.ashx" type="System.Web.UI.SimpleHandlerFactory"/>
. . . . . .
 . . . . . .
</httpHandlers>

look at the error again, I guess, IIS must have been configured properly. The onlything I can think of is your mypage.ashx failed during complication (which unncessarily means the code is wrong, it's just failed to compile or render at runtime). IIS then refuses to map your file the the associated extension and handler.

What I do is odd, but I restart everything :(.

Another time when we worked with rails extension, we accidently remove one of our handler mapping extension and it took me a while to figure out we have to add it again.

(just incase you want another reference, here how you add new extension)



Extension-mapping-IIS.JPG
0
 
LVL 4

Author Comment

by:Brimba
ID: 22819574
I dont know how this can help me.
Since the problem only exists for a ouple of minutes and without making a restart or anything it goes away for days.
0
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 250 total points
ID: 22820165
Yes, I agree this is odd, but this is IIS and Dotnet Framework problems, we have to live with that. As I said, at some states, IIS just fail to compile and map your handler in a proper way.

This is really annoying. May be you can report to these Ms people for fixing what really going on

JINN
0
 
LVL 4

Author Comment

by:Brimba
ID: 22832016
ok, thanks.
0
 
LVL 2

Expert Comment

by:Dinesh Subramanian
ID: 35250101
The ashx isn't a page, it's a mapping. For the sake of anyone else having issues with this, the problem was a configuration problem in the web.config. IIS 7 requires that the handlers are declared in 2 different sections: system.web and system.webServer. I was missing the declaration in system.webServer.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

791 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question