Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I suspect your problem is ocurring before you ever hit the BaseService code, so you are not actually throwing an AggregateException. You need to determine what exception is being thrown, the easiest way is by debugging on the server, the next easiset is to hook up some logging.</p> <p>If you want to be able to easily track this stuff and have the ability to manipulate faults etc the best bet is to implement IErrorHandler, a basic implementation that I use usually goes along the following lines:</p> <pre><code>public class ErrorHandler : IErrorHandler { private readonly Action&lt;Exception&gt; LogException; private readonly Action&lt;Message&gt; LogFault; public ErrorHandler(Action&lt;Exception&gt; logException, Action&lt;Message&gt; logFault) { LogException = logException; LogFault = logFault; } public void ProvideFault(Exception error, MessageVersion version, ref Message fault) { if (error is FaultException) // Thrown by WCF - eg request deserialization problems, can be explicitly thrown in code { LogFault(fault); return; } var faultCode = new FaultCode("UnknownFault"); if (error is ArgumentOutOfRangeException) { faultCode = new FaultCode("ArgumentOutOfRange"); } var action = OperationContext.Current.IncomingMessageHeaders.Action; fault = Message.CreateMessage(version, faultCode, error.Message, action); LogFault(fault); } public bool HandleError(Exception error) { // Logging of exceptions should occur here as all exceptions will hit HandleError, but some will not hit ProvideFault LogException(error); return false; // false allows other handlers to be called - if none return true the dispatcher aborts any session and aborts the InstanceContext if the InstanceContextMode is anything other than Single. } } </code></pre> <p>Note the above code wont cater for your AggregateException exactly but will get you on the right track, you will also need to inject the error handler if you choose to go down this route.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload