In response to Tadas answer, I came up with the following code that works for me (note that I translated this from VB without checking if it compiles, therefore YMMV):
bool foundElmah = false; foreach (var m in HttpContext.Current.ApplicationInstance.Modules) { var module = HttpContext.Current.ApplicationInstance.Modules.Item(m); if (module is Elmah.ErrorLogModule || module is Elmah.ErrorMailModule || module is Elmah.ErrorFilterModule || module is Elmah.ErrorTweetModule) { foundElmah = true; break; } } if (foundElmah) {
This also addresses the issues that I encountered getting a 401 response when requesting elmah.axd (I used Windows authentication) and is much faster, and I don't assume this is the place for elmah.axd.
source share