Sam Gentiledetails some of the problems our team has run into over the past few months (not just our team, but othersaswell) regarding the use of custom exceptions in Enterprise Services / COMPlus. The problem is that custom exceptions were not easily travelling across the ES/COMPlus wire. In particular, custom exceptions were reverting back to their base exception when thrown from an ES/COMPlus Server Application. We figured out the “why“ (as Sam mentions in his post), but we had no good solution to get around it.
Sam mentions a March, 2004 MSDN Magazine article by Bob DeRemer titled Throwing Custom Exception Types from a Managed COMPlus Server Application that shows a couple of nice solutions to this problem. The article is not yet available online, but the code is available for download here: MSDNMag0403 code.