Exception handling in .NET remoting

V

Vinay

Hi,
Can anyone tell me how can I handle/catch exception
thrown by remoting object on client machine? Can some one
give me pointer? Actually I am connecting to two machines
and one of them throws exception, I want to identify that
particular machine on which remote object is throwing
exception.

Thanks,
Vinay
 
N

Nicholas Paldino [.NET/C# MVP]

Vinay,

That is going to be something for you to decide. You can only link up
one type to a remote host (you can't get an instance of type A from App
Domain A, and another from App Domain B, they must both be remoted from the
same app domain). So, what you have to do is have some sort of mapping
between the type and the machine it is remoted from.

You can figure out the type from the exception, using the StackTrace
offered by the Exception, and this will give you a MethodInfo instance which
will point to the type of the object.

Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top