C # how to find out if a remote object implements an interface

Is there a way to find out if the remote object implements the interface (I cannot change / add methods to the remote object).

Indeed, I cannot use IsAssignableFrom or "as" for testing as it is a remote object. Then I have an exception when I try to call unimplemented methods.

thanks

+2


a source to share


1 answer


System.Runtime.Remoting.ObjectHandle oh = Activator.CreateInstanceFrom(Assembly.GetEntryAssembly().CodeBase, typeof(SomeType).FullName);
SomeType st = (SomeType) oh.Unwrap();

      



And then check if the interface implements your interface?

0


a source







All Articles