【问题标题】:COM+: ApplicationException instead of thrown exceptionCOM+:ApplicationException 而不是抛出的异常
【发布时间】:2010-09-23 12:59:12
【问题描述】:

我有一个调用 COM+ 组件的 ASP.net 网络服务。 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

【问题讨论】:

    标签: .net web-services exception-handling com+ servicedcomponent


    【解决方案1】:

    如果异常是从 ServicedComponent 的构造函数中抛出的,则抛出 ApplicationException 而不是真正的异常。

    我会将答案奖励给任何能说出我原因的人。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-07-27
      相关资源
      最近更新 更多