Pregunta

Tengo una ASP.net servicio web que llama a un componente COM +. Una clase en el componente COM + lanza una excepción que quiero manejar. Pero ApplicationException es capturado por el webbservice en lugar de la excepción real.

¿Por qué es eso?

Editar: Detalles de la excepción

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
¿Fue útil?

Solución

ApplicationException se lanza en lugar de la excepción real si la excepción desde dentro del constructor de la ServicedComponent.

Voy a adjudicar la respuesta a cualquiera que pueda decirle a mi por qué.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top