wcf fault exception not throwing/being caught properly

449 views Asked by At

This is the exception I get:

An exception of type 'System.ServiceModel.FaultException`1' occurred in TestService.exe but was not handled in user code

I try to run my client and the debugger gets caught when I try to do the following

catch (Exception ex)
    throw new FaultException<GeneralCalculatorFault>(fault, ex.ToString());

What could be the problem. Let me know if I need to provide more info.

1

There are 1 answers

0
Price Jones On

I answered the question myself. It was giving me trouble because of a setting in Visual Studio 2012.

Whenever the exception was thrown if I pressed "Continue", it handled everything just fine on the client side just like it should. There is a checkbox on the server side that allows me to ignore exceptions of particular types, so I checked it and now the server side no longer complains that the exception is not being handled.

Maybe this will help some other newbie like me. :)