Silverlight 4 WCF Server-side Exceptions are harder to deal with than they should be.
All I want is a nice stacktrace from the server to the client. Is that so hard to ask? Apparently, it is.
Honestly, I don't care what soap or security requires. I don't think I've gotten an explanation as to why it was hard in Silverlight 2/3.
Read these and let your eyes glaze over at the hacks:
http://msdn.microsoft.com/en-us/library/dd470096(VS.95).aspx
http://forums.silverlight.net/forums/p/12698/45061.aspx
http://forums.silverlight.net/forums/p/147717/328978.aspx
Fortunately, Silverlight 4 makes it "easy" by switching the client-side http stack. Which is buried on an updated version of the first link above: http://msdn.microsoft.com/en-us/library/ee844556(VS.95).aspx
Of course, there can be some gotchas by using a http stack that isn't in the browser. For me, I'm not sure what they are. Seemingly, the only thing is that you cannot access cookies. However this solves my problem.
http://msdn.microsoft.com/en-us/library/system.net.browser.webrequestcreator.clienthttp(VS.95).aspx
http://msdn.microsoft.com/en-us/library/system.net.browser.webrequestcreator.browserhttp(VS.95).aspx
Now, all I have to do is includeExceptionDetailInFaults="true" on the serverDebug element and I'm in the business of catching FaultException<ExceptionDetail> objects.
This does all feel a bit sloppy, but then again, so does the "correct" way.