title: WCF FaultException IErrorHandler - Not returning to client and causing timeout exception
body: <p>I am trying to implement IErrorHandler in the WCF services that uses iis and net.tcp.</p>
  
  <p>I set a scenario to throw DivideByZeroException in the server. IErrorHandler is firing as expected. </p>
  
  <p>The FaultException is not returning to client and I am getting timeout exception. I could not find any info/exception in event log also.</p>
  
  <p>Here is the demo code.
  <a href="http://www.fileswap.com/dl/gQFlVsZK7M/" rel="nofollow">http://www.fileswap.com/dl/gQFlVsZK7M/</a> (Please click on slow download image)</p>
  
  <p><strong>EDIT 1 (added code from archive for all to see it):</strong></p>
  
  <p><em>Service contract:</em></p>
  
  <pre><code>[ServiceContract]
  public interface IService1
  {
  
      [OperationContract]
      [FaultContract(typeof(DivideByZeroException))]
      string GetData(int value);
  
      [OperationContract]
      [FaultContract(typeof(DivideByZeroException))]
      CompositeType GetDataUsingDataContract(CompositeType composite);
  
      // TODO: Add your service operations here
  }
  </code></pre>
  
  <p><em>Service Implementation:</em></p>
  
  <pre><code>public class Service1 : IService1
  {
      public string GetData(int value)
      {
          int i = 0;
  
          //division by zero!
          int y = 10/i;
          return string.Format("You entered: {0}", value);
      }
  
      public CompositeType GetDataUsingDataContract(CompositeType composite)
      {
          if (composite == null)
          {
              throw new ArgumentNullException("composite");
          }
          if (composite.BoolValue)
          {
              composite.StringValue += "Suffix";
          }
          return composite;
      }
  }
  </code></pre>
  
  <p><em>IErrorHandler implementation:</em></p>
  
  <pre><code>public class WcfErrorHandler : IErrorHandler
  {
      public void ProvideFault(Exception error, MessageVersion version, ref Message fault)
      {
          var v = error as DivideByZeroException;
          if (v != null)
              fault = Message.CreateMessage(
                  version,
                  new FaultException&lt;DivideByZeroException&gt;(v, new FaultReason(v.Message)).CreateMessageFault(),
                  "http://the.fault.action");
      }
  
      public bool HandleError(Exception error)
      {
          return true;
      }
  }
  </code></pre>