2

I have my client calling a WCF Server I'm hosting locally, right now I'm debugging the client so on the server I'm purposely throwing a FaultException to see how the client would handle it.

The part that is annoying is that the debugger pauses on the line that throws the FaultException. How do I get it to NOT do that? I looked in Visual Studio's Options (Debugging) and don't see anything that resembles an option for this.

michael
  • 14,844
  • 28
  • 89
  • 177

2 Answers2

4

Use the DebuggerStepThrough attribute on the method you wish the debugger to skip over.

Mike Atlas
  • 8,193
  • 4
  • 46
  • 62
3

You can configure the debugger to ignore certain exceptions by going to "Debug -> Exceptions" (shortcut: Ctrl+Alt+E) and unchecking "user-unhandled" for the exceptions or their namespace.

Disable either System.ServiceModel.FaultException`1 For Typed FaultExceptions (FaultException< TDetail >) or System.ServiceModel.FaultException for both typed and untyped FaultExceptions.

Find both by searching for the words "Fault" with "Find ..." or by expending "Common Language Runtime Exceptions-> System -> System.ServiceModel"