Why Wildcard application mapping is not catching 404s

I recently did a brain-dump about IIS6 Request Processing and detailed how Wildcard application mappings fit in. Let’s apply that info to the following question…


Hi David,

Sorry to bother through here but I couldn’t find an online answer… or something may be wrong with my VPC installation… not sure. Thing is I’ve setup in IIS6 a wildcard entry to aspnet_isapi.dll in order to get all request through ASP.NET (I made sure the “Verify that file exists” is not checked) and I still can’t get the requests to my ASP.NET app. I’m getting IIS 404 error for non-existent URLs… (that I would like to handle in my ASP.NET app).

Any idea of where else to look for this?



First, you want to read this blog entry on how IIS6 Request Processing works and how wildcard application mapping fits into the overall picture.

Wildcard application mapping is definitely able to catch requests for non-existent URLs. I confirmed using my test ISAPI DLL, configured as a wildcard application mapping, that it DOES get invoked with the correct ServerVariables for the non-existent URL when “Verify that file exists” is unchecked. This tells me that ASPNET_ISAPI.DLL definitely gets invoked for those requests.

You are claiming that you:

  1. See IIS 404 errors, which suggest that ASPNET_ISAPI.DLL did not get invoked (ASP.Net does not read nor send IIS custom errors)
  2. Correctly configured ASPNET_ISAPI.DLL to act as a wildcard application mapping applicable for the non-existent URL.

Unfortunately, those two claims directly contract each other, and combined with what I had earlier confirmed, I can only conclude that one of your two claims is mistaken. Either you did not see the IIS 404 custom error response, or you did not configure ASPNET_ISAPI.DLL to act as a wildcard application mapping applicable for the non-existent URL.

Now, since the former is very hard to mistake (IIS and ASP.Net custom error responses are very different), I suspect that some form of the latter is going on. Here is one possible explanation.

The IIS configuration for wildcard application mapping is inheritable from the parent to the child, unless overriden. This means that if you change wildcard application mapping at the global level, then it will apply to all applications on the server UNLESS that application has a local override.

ASP.Net constantly tweaks the property containing wildcard application mappings to make them local-override, so I think that you have a local-override applicable to the non-existent URL that does NOT match your perceived setting of wildcard application mapping.

The fix is easy – either:

  1. Modify the local-override to include your wildcard application mapping.
  2. Delete the local-override so that it inherits from your perceived setting.

Another possibility that you want to consider is how Default Document resoluotion can be affected by a wildcard application mapping. Read the following blog entry for more details and explanations.

Now, if it still does not work after this (so you are sure that ASPNET_ISAPI.DLL is getting invoked to handle the non-existent URLs), then the issue is really an ASP.Net question and no longer an IIS6/wildcard application mapping question. Unfortunately, I am not an ASP.Net expert, so I do not know why ASP.Net is not invoking the applicable HttpHandler, HttpModule, or ASP.Net app to handle the non-existent URL. You will probably get better support for this question at the ASP.Net Forums on www.asp.net .

Good Luck.


Comments (4)

  1. Tenho pesquisado muita coisa sobre o request pipeline do IIS esses dias e volta-e-meia eu acabo caindo…

  2. Andrew Powell says:

    I know this is a really old post, but this is exactly what we are dealing with. We have several installs of 2003 WebEdition installed through VMWare. IIS will not execute the aspnet_isapi lib even though we have the settings correct (and verified with ms through a support call, for good measure). It works perfectly on a regular install. Through the VM it does not execute properly.

    andrew at stardock dot com if you happen to know of a solution for this.

  3. David.Wang says:

    Andrew – Are you sure the 404s came from the IIS inside of VMWare (i.e. is this just a networking problem related to VMWare). Please verify with IIS web log entries inside the VM.

    IIS does not distinguish between virtual and physical machines, so I don’t think it is an IIS issue. And you are saying that MS support call eliminates the configuration issue. So, the issue comes from some aspect of VMWare, and networking is the first thing that comes to my mind.


  4. Doug says:

    Outstanding help.  We have a clustered iis server environment and one of the machines has the "Verify that file exists" checked, which kept causing the 404 errors.