C# – How to prevent a WCF service from enter a faulted state


I have a WCF Service that should not enter the faulted state. If there's an exception, it should be logged and the service should continue uninterrupted. The service has a one-way operation contract and is reading messages from an MSMQ.

My problems are twofold:

  1. The service appears to be swallowing
    an exception/fault so I am unable to
    debug it. How do I get the service
    to expose the exception so that I
    can log or handle it?
  2. The service is
    entering into a faulted state after
    this exception is swallowed. How do
    I prevent the service from entering
    into a faulted state?

Best Solution

The official documentation on how to handle Faults is here:

with the main page being at Channel Model Overview

There's a nice state diagram showing how things happen:

enter image description here

Related Question