title: FaultException and custom exception WCF
body: <p>I have a question on how to send a custom exception as FaultException. It works when I use a system Exception like ArgumentException, but if I change it to my custom exception  "TestException" it fails. I can’t get the configuration for the service reference, when I try to add it.</p>
  
  <p><strong>Works:</strong></p>
  
  <pre><code>[OperationContract]
  [FaultContract(typeof(ArgumentException))]
  [TransportChannel TestMethod ();
  
  
  public Void TestMethod()
  {
              throw new FaultException&lt;ArgumentException&gt;(new ArgumentException("test"), new FaultReason("test"));
  }
  </code></pre>
  
  <p><strong>Doesn’t work:</strong></p>
  
  <pre><code>[OperationContract]
  [FaultContract(typeof(TestException))]
  [TransportChannel TestMethod ();
  
  
  public Void TestMethod()
  {
              throw new FaultException&lt;TestException&gt;(new TestException("test"), new FaultReason("test"));
  }
  </code></pre>
  
  <p><strong>My “TestException” looks like this:</strong></p>
  
  <pre><code>[Serializable()]
  public class TestException: Exception
  {
      public TestException () : base() { }
      public TestException (string message) : base(message) { }
      public TestException (string message, Exception innerException) : base(message, innerException) { }
      public TestException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context) : base(info, context) { }
  }
  </code></pre>
  
  <p>I guess I have to add a DataContract on the custom object, but I don’t understand why it won’t work like it is, since the ArgumentException works. Can someone enlighten me? </p>
  
  <p>Thanks for help :)</p>