Returning Meaningful Exceptions from a WCF Project
- by MissingLinq
I am pretty new to WCF in general. What little experience I have comes from using fairly simple .SVC services in ASP.NET web applications.
I tried experimenting with using a WCF Project for the first time, and ran into a major show-stopper.
As I’m sure most are aware, for some strange reason, in a web application in which the customErrors mode is set to On , services (both .ASMX and .SVC) will not return exception details to the client. Instead, the exception and stack trace are emptied, and the message always reads “There was an error processing the request”, which is not at all helpful.
When services are directly hosted inside the web application itself, it’s easy to work around this restriction by placing the services in a dedicated folder, and setting for that folder.
However, I’m running into this same issue with exceptions not being returned from services that live in a separate WCF project. Thing is, I don’t know how to work around that.
In a nutshell: I need to get my WCF Project services to bubble REAL exceptions to the client – or at least, the original exception message, instead of “There was an error processing the request”.