我有一个透明代理,例如由WCF生成的代理:
ChannelFactory<ICalculator> channelFactory =
new ChannelFactory<ICalculator>(
new NetNamedPipeBinding(),
"net.pipe://localhost/WcfTransparentProxy/Calculator" );
ICalculator calculator = channelFactory.CreateChannel();
如何从透明代理获取RealProxy?
答案 0 :(得分:11)
RemotingServices中有一个专门用于此的功能:
System.Runtime.Remoting.RemotingServices.GetRealProxy( transparentProxy );