views:

14

answers:

1

I got a ASP.net webservice which calls a COM+ component. A class in the COM+ component throws an exception which I want to handle. But ApplicationException is caught by the webbservice instead of the real exception.

Why is that?

Edit: Exception details

System.ApplicationException: Error in the application.
   at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
   at System.EnterpriseServices.Thunk.Proxy.CoCreateObject(Type serverType, Boolean bQuerySCInfo, Boolean& bIsAnotherProcess, String& uri)
   at System.EnterpriseServices.ServicedComponentProxyAttribute.CreateInstance(Type serverType)
   at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props, Boolean bNewObj)
   at mywebbservice.Batplanering.Behorighet(String sprak) in D:\utv\Bat\Main4\Src\mywebbservice\planering.asmx.vb:line 3542
A: 

ApplicationException is thrown instead of the real exception if the exception is thrown from within the constructor of the ServicedComponent.

I'll award the answer to anyone who can tell my why.

jgauffin