【发布时间】:2012-12-26 09:40:37
【问题描述】:
我正在开发一个 .Net Remoting 项目。我想监视远程调用和返回值或可能的异常。 我实现了 IMessageSink
Public Function SyncProcessMessage(ByVal msg As System.Runtime.Remoting.Messaging.IMessage) As System.Runtime.Remoting.Messaging.IMessage Implements System.Runtime.Remoting.Messaging.IMessageSink.SyncProcessMessage
Dim replyMsg As IMessage = _NextMessageSink.SyncProcessMessage(msg)
if {ReplyMsg Contains Exception of type a} then
do something
else if {ReplyMsg Contains Exception of type b} then
do someshing else
End If
Return replyMsg
End Function
当服务抛出异常时,ReplyMsg 只包含LogicalCallContext。 如何找到异常类型?
【问题讨论】:
-
顺便说一句,我希望您知道远程处理已被弃用以支持 WCF?
-
是的,但这是一个庞大的系统,多年前就实施了,我们现在不能迁移到 WCF,我只是在更改 ChannelSinks。
标签: .net exception remoting channel