我正在做一个 .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。我怎样才能找到异常类型?