I can't find a variable named sourceStream in the RIA Services code outside of a test method in the OData tests. I can tell you from the stack trace that the error happens when attempting to execute an Invoke method in your Domain Service.
If customerrors is turned on then RIA Services suppresses the actual error when it creates the fault so WCF logging will not see it.
Thanks for the reply. The only thing I found when I searched our code base was a private variable in Silverlight code which is not involved in an invoke operation. I don't think this would be it.
I think CustomErrors needs to be turned completely off to allow the errors to be logged by WCF logging, the RIA Services hosting code specifically checks for that. What you can do is override the OnError method of the DomainService and log the error yourself from there.
We are already logging from DomainService.OnError but these issues do not seem to get channelled through there. It is sounding like I will need to turn off CustomErrors completely to ensure that we do not lose any error details.
Do you think that it would make sense to control logging with some other configuration so that CustomErrors and RIA Services logging can be turned on and off independently?
Logging is handled by WCF, it isn't something that we have any control over. If RIA Services is leaking exception information to WCF for logging, it is also leaking it to the client.