FaultException
is exception transfered from other side of WCF channel. Meaning, that exception did not happen on line you call tc.GetAllCategories();
, but on server side, in processing of that method.
FaultException
wraps exception which occurred on server side. From what we can see in what you pasted, it's NullReferenceException
. To find exact place where it occurs, set breakpoint in GetAllCategories
method and step through it until it fails. Since this is a WCF service, exception in handling method call does not crash the service, but wraps the exception and sends it back to client.
Another way to find where error occurs would be to debug service, open Debug -> Exceptions in Visual Studio and tick check box in Thrown column next to Common Language Runtime Exceptions. This tells VS debugger to stop execution when error occurs, even though exception will be caught by WCF.