COM+:ApplicationException 而不是抛出异常
我有一个 ASP.net Web 服务,它调用 COM+ 组件。 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果异常是从 ServicedComponent 的构造函数中引发的,则将引发 ApplicationException 而不是真正的异常。
我会将答案奖励给任何能告诉我原因的人。
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.