Question

Je suis un ASP.net webservice qui appelle un composant COM +. Une classe dans le composant COM + lance une exception que je veux gérer. Mais ApplicationException est pris par le webbservice au lieu de la véritable exception.

Pourquoi est-ce?

Modifier: détails d'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
Était-ce utile?

La solution

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

Je vais décernent la réponse à tous ceux qui peuvent dire à ma raison.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top