Hello,
I'm hosting WCF services in Asp.net web page in ASP.NET Compatibility Mode (AspNetCompatibilityRequirementsMode.Allowed). I've written simple HttpModule:
public class ExceptionInterceptor : IHttpModule
{
public ExceptionInterceptor()
{
}
public void Dispose()
{
}
public void Init(HttpApplication context)
{
context.Error += new EventHandler(context_Error);
}
void context_Error(object sender, EventArgs e)
{
// do something
}
}
web.config:
<httpModules>
<add name="ExceptionInterceptor" type="HttpModules.ExceptionInterceptor, HttpModules"/>
</httpModules>
My question is, why after occurence of unhandled exception in service, the code do not enter in context_Error(object sender, EventArgs e)
function in my module.
What's more, the code do not even enter the Application_Error(object sender, EventArgs e)
in Globals.asax.
Can someone explain that to me ?
What is the best option for global exception handling in WCF services ?
Regards