title: HttpModule and WCF (AspNetCompatibilityRequirementsMode.Allowed)
body: <p>I'm hosting WCF services in Asp.net web page in ASP.NET Compatibility Mode 
  (<strong>AspNetCompatibilityRequirementsMode.Allowed</strong>). I've written simple HttpModule:</p>
  
  <pre><code>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
      }
  }
  </code></pre>
  
  <p>web.config:</p>
  
  <pre><code>&lt;httpModules&gt;
          &lt;add name="ExceptionInterceptor" type="HttpModules.ExceptionInterceptor, HttpModules"/&gt;
  &lt;/httpModules&gt;
  </code></pre>
  
  <p>My question is, why after occurence of unhandled exception in service, the code do not enter in <code>context_Error(object sender, EventArgs e)</code> function in my module. </p>
  
  <p>What's more, the code do not even enter the <code>Application_Error(object sender, EventArgs e)</code> in <strong>Globals.asax</strong>.
  Can someone explain that to me ?</p>
  
  <p>What is the best option for global exception handling in WCF services ?</p>
  
  <p>Regards</p>