0

I've deployed an ASP.NET 3.5 app to a 64bit Windows 2003 R2 server.

In the web.config I have the following

<customErrors mode="RemoteOnly"
              defaultRedirect="/404/">
  <error statusCode="404"
         redirect="/404/"/>

  <error statusCode="500"
         redirect="/500/"/>
</customErrors>

In the website properties in IIS Manager I have set the 404 and 500 errors to Type = "URL" and the same URLs as in the web.config.

I have a wildcard application map to the .NET 2.0 aspnet_isapi.dll with "Verify file exists" turned off.

If I try to hit a fake .aspx file I successfully get sent to the 404 page. I belive this is because there is an explicit mapping for .aspx to the .NET DLL.

If I try to access a fake directory I simply recieve a plain text response saying:

The system cannot find the file specified.

It would appear that these requests for directories are not being routed through the .NET pipeline, which is what I would expect (and need) to happen becuase of the wildcard application mapping.

Any ideas?

3 Answers 3

1

To test your logic, I actually walked through the complete process. I used ETW tracing for IIS and ASP.NET and Process Monitor to see what's happening. Here is what I find:

  1. When you add "Wildcard mapping" for aspnet_isapi.dll with "Verify that file exists" unchecked, all the request actually passes through the .net pipeline
  2. When you access a fake directory, .net actually looks for all .config files.. i.e. machine.config, root web.config (that's in C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG) and your Web site root directory to look for a possible HttpHandler that can handle your request
  3. Since none of the handler's are configured to handle "directory" request, the request falls back on IISGeneral: GENERAL_STATIC_FILE_HANDLER and fails with 0x80070002 i.e. FILENOTFOUND
  4. Since you have IIS Custom Error 404 configured as /404/, it looks into the directory c:\inetpub\wwwroot\404\, fails with another 0x80070002 and sends a generic The system cannot find the file specified. error.
  5. When you access a fake main.aspx page, .aspx request is handled in the root web.config file and hence you see a .net specific (The resource cannot be found.) error.

  6. Now, when you check "Verify that file exists" for the "Wildcard mapping", the server checks that the requested script exists before mapping an extension to an application
  7. Hence, the request never passes through the .net pipeline and gives you the error as stated in point 4.


Hope this helps.

1
  • You're a Legend!
    – Greg B
    Mar 11, 2010 at 11:18
1

For IIS 5.0, the happy trail is:

Properties > Home Directroy > Advanced Configuration: select the file extension you are interested in and check the 'Verify file exists' checkbox.

0

If you have a wildcard mapping without the "verify file exists" turned on it will send the request to your DLL. If the ASP.Net 2.0 DLL that you have it mapped to is NOT using the web.config for your application (you mentioned that was for .Net 3.5) then it would return a generic error. If you enable the "verify file exists" option IIS will see that the folder isn't there and use its internal error settings instead (which you said are the same as what's in the web.config). Perhaps try turning that option on to see if helps in your situation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .