0

J'ai obtenu un service Web ASP.net qui appelle un composant COM +. Une classe dans le composant COM + génère une exception que je veux gérer. Mais ApplicationException est interceptée par le webbservice au lieu de l'exception réelle.COM +: ApplicationException au lieu de l'exception levée

Pourquoi est-ce?

Edit: Détails de l'exception

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 

Répondre

0

ApplicationException est jeté au lieu de la véritable exception si l'exception est levée à partir du constructeur de la ServicedComponent.

Je vais attribuer la réponse à tous ceux qui peuvent dire pourquoi.