TransparentProxy and Reflection



I'm using reflection to instantiate classes and then to invoke methods
on the instances. Things have been going pretty smoothly actually
until I tried to pass in a MarshallByReference object. When I try to
invoke a method from the interface that the object implements, I get an
exception complaining that the method isn't found. And sure enough,
the actual type of the object presented to me is a TransparentProxy.
No surprise there if I'd thought about it.

So my question is, How do I use reflection to invoke a method on an
MBR/TransparentProxy object? I can't do any kind of cast since I don't
know the type at compile time, only at runtime. I thought maybe the
Convert package would give some help, but the object needs to implement
IConvertable.

If I look at the System.Runtime.Remoting.ObjRef and the
IRemotingTypeInfo in the debugger, the information is there, but in
private/protected fields. At this point, I'm stuck.

Any thoughts?

Thanks,
Russell.

.



Relevant Pages

  • Re: How to query n web services
    ... When I added web references, I wrote 10 different web references name. ... and then invoke service01.someMethod... ... The subset is given by strings. ... Using Reflection, you can use a string to create an instance of an object and then invoke methods on that instance. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: How can I detect the presense of an optional assembly and call a method within it?
    ... Basically you will need to use Reflection. ... allows you to dynamically create instances at runtime and invoke method. ... > 1- Read a configuration file where the client provides the assembly name ... > (DLL) and the ...
    (microsoft.public.dotnet.languages.csharp)
  • Reflection Issues
    ... I"m trying to invoke a method using reflection on a DLL that is already ... Reflection in the past, so I'm familiar with Reflection a little bit. ... classes and assemblies are very complex to invoke, ... Any advice on trying to track ...
    (microsoft.public.dotnet.languages.csharp)
  • invoke a method by reflection£¬the methods parameters can not be ArrayList?
    ... I invoke a method by reflection, when this method's parameters is simple ... type like int or string,the invoking is correct and secceed. ...
    (microsoft.public.dotnet.languages.csharp)
  • invoke a method by reflection£¬the methods parameters can not be ArrayList?
    ... I invoke a method by reflection, when this method's parameters is simple ... type like int or string,the invoking is correct and secceed. ...
    (microsoft.public.dotnet.framework)