Last post Jul 07, 2010 09:52 AM by larryv
Jul 06, 2010 08:57 PM|larryv|LINK
I posted this on the
microsoft.public.dotnet.general newsgroup. But since one of the code snippets I reference is from this site I wonder if someone here can help me.
I have implemented an error handling httpmodule similar to the one described here:
If I run the application locally through the Visual Studio Development Server everything works as expected. On the live server I have IIS setup in the Application Configuration so that there are no ISAPI extensions and with the wildcard mappings go to the
dotnet dll, and I have the checkbox to "Verify that the file exists" turned off.
In my web.config I have the following:
<customErrors mode="RemoteOnly" defaultRedirect="~/_errors/500-server-error.aspx">
<error statusCode="403" redirect="~/_errors/403-forbidden.aspx"/>
<error statusCode="404" redirect="~/_errors/404-page-not-found.aspx"/>
<add name="HttpErrorModule" type="tmpw.applicationname.App_Code.HttpErrorModule, applicationname" />
And under IIS errors I have it set up so that 404 errors go to the same 404 URL in web.config.
The behavior I am expecting is that if I go to appliationname.com/xyz.html and it does not exist, it is kicked into the error handling code. The error handling module is set up to log the event and I should get an email. And even failing that the 404 page
should still load in IIS settings.
The error handling code does kick in if I go to appliationname.com/xyz.aspx - a page which does not exist. But for any other file extension I do not get the expected result.
Heres what happens. The application starts as expected and the code I have in Application_BeginRequest in global.asax does get called. But at the end of that block it stops processing. It never makes it to the http module code. Instead I get a "The request
is not supported." response.
The application I am working on is a migration of older code. I want to be alerted to every 404 that comes through the application so that I can see if we missed anything. I could potentially get this sort of information from the IIS logs I suppose but I
really shouldn't have to. Does anyone have any idea why I get a "Request Not Supported" error when processing an HTML page, and more so, why I only get it when running the application through IIS and not through Visual Studio?
Jul 07, 2010 09:52 AM|larryv|LINK
A few changes. I deleted the configuration in IIS and recreated it. Previously I had deleted the ISAPI extensions and just put in the wildcard. Now I left them in. This seems to have alleviated the "Request Not Supported" issue. But the application is still
not processing calls to HTML files through the error module. Any ideas?