Solved

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

Posted on 2008-10-23
8
830 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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

777 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