com+:applicationException而不是投掷异常
-
04-10-2019 - |
题
我得到了一个称为com+组件的ASP.NET Web服务。 COM+组件中的类引发了我要处理的异常。但是ApplicationException被WebBservice而不是实际异常所捕获。
这是为什么?
编辑:异常细节
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
解决方案
如果异常是从ServicedComponent的构造函数中抛出的,则抛出ApplicationException而不是真实异常。
我将向任何能告诉我为什么的人授予答案。
不隶属于 StackOverflow