Last post Jul 07, 2013 01:47 AM by magicmike2011
Mar 28, 2013 05:54 PM|ojm37|LINK
How do I configure my httpModule so that all errors go through it?
Here's how I have it configured in my web.config (it handles begin_request, authorize_request, etc. just not application_error):
in <system.webServer> I have
<add name="My Module Name" type="namespace.name"/>
Like I said, the application.BeginRequest and other events fire fine. However, when I get an error not handled in other code, the application.error event does not fire.
Any help TIA,
Mar 28, 2013 06:07 PM|ojm37|LINK
Hmmm. We did have this working at one time. Not sure when it quit working. However, we did implement web-api recently and now we have a global.asax file (where we had none before). Related?
Mar 29, 2013 10:36 AM|ojm37|LINK
I don't think it's global.asax. At any rate, all errors go through the HTTPModule on my developer machine (Windows 7 Ultimate), but not on the development Server or on the Production Servers (both Windows Server 2008 R2 Standard). What do I need to set
up to make the errors go through the httpModule on the servers?
Apr 01, 2013 03:14 AM|srinathgnath|LINK
In Windows Server 2008 R2 Standard, the built in iis version is 7.5. The issue may be related to iis. So please have a look into the below article.
Apr 03, 2013 10:40 AM|ojm37|LINK
The link should be:
However, it doesn't solve the problem All other application events (and thus the httpModule) are working fine. Just Errors are not working.
Apr 15, 2013 01:51 PM|ojm37|LINK
Anyone? Why does the server O/S version of IIS work differently than Windows 7?
Apr 23, 2013 10:37 AM|ojm37|LINK
Got this from Microsoft at:
This looks like it's likely an environmental configuration issue given that it works locally on your developer machines but not on your target server. Please ask this question in the ASP.NET forums at http://forums.asp.net/ One thing to note is that if you're
running the Visual Studio Development server locally (aka Cassini) then 404's for static file requests will result in the application error logic being hit, however this is not the case on IIS unless you have RAMMFAR (RunAllManagedModulesForAllRequests) enabled
in your web.config file.
I checked, and our Web.config file already has:
Along with our add name for our httpModule. So, what am I missing? Works fine on our developer machines (Windows 7, IIS7) but does not work on either our development or production servers (Windows 2008 R2, IIS7.5).
May 15, 2013 01:15 PM|ojm37|LINK
So, anyone have any ideas about what might be configured differently? The web.config file is identical. I'm going through the IIS config dialogs now but so far have not found anything significantly different.
Jul 07, 2013 01:47 AM|magicmike2011|LINK
1. Make sure it's registered properly.
2. on application start, make sure you register it for the OnError event, within the global.asax.
Viola. It will catch all application level errors. Anything outside of the AppDomain will not be caught though, but there wouldnt be much you could do about that within the app anyway.