I need to call a method with ref-arguments through a RealProxy. I have isolated the problem down to the following code:
using System;
using System.Reflection;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Remoting.Proxies;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
...
I have a transparent proxy, for instance one generated by WCF:
ChannelFactory<ICalculator> channelFactory =
new ChannelFactory<ICalculator>(
new NetNamedPipeBinding(),
"net.pipe://localhost/WcfTransparentProxy/Calculator" );
ICalculator calculator = channelFactory.CreateChannel();...
I'm working up a system where I plan on using RealProxy objects to enable intercepting method calls against a set of objects, handling the call, and then returning appropriate results.
This works just find for simple return types like strings or ints, but I can't seem to return objects from the RealProxy.Invoke method.
Everything works...
I'm trying to handle a call of a generic method through a RealProxy, but I cannot seem to find the information about the actual type of the generic parameter used in the intercepted method call. An excerpt of the code:
public override IMessage Invoke(IMessage msg)
{
...
string methodName = (string)msg.Properties[...