3

As I remember correctly, in .NET Framework 3.x, a WCF service client (ClientBase<T>) would get a faulted state when the service returned an exception (FaultException). This could result in problems when the service client was not disposed / closed correctly. (See the many posts about this subject, like: What is the best workaround for the WCF client `using` block issue?).

This behavior has been changed! Somehow, when the service throws an exception, the service client rethrows that exception, but the client does not enter a faulted state anymore.

Two questions:

  1. Under which conditions does the service client enter a faulted state?
  2. Since when (what framework version or patch) has this behavior been altered?
Martin Mulder
  • 12,642
  • 3
  • 25
  • 54
  • Unplug the network cable? –  Jun 22 '17 at 08:41
  • @MickyD: I did not try that. I did try to turn off a service before opening a channel or halfway communication. – Martin Mulder Jun 22 '17 at 08:44
  • I could not find documentation about `ServiceClient`. Is `ServiceClient` similar to `IClientChannel`? With a `ChannelFactory` and `CreateChannel()` I can get the client into `Faulted` state by connecting to an unexisting EndPoint, but that appears not to work for the OP. – Kasper van den Berg Oct 24 '17 at 11:50
  • Sorry, my mistake; I used the wrong class name. I changed it to `ClientBase`. – Martin Mulder Oct 26 '17 at 14:18

0 Answers0