检测透明代理与实际对象引用?

red*_*man 6 .net c# remoting

给定一个对象引用,是否可以以编程方式确定对象是在当前appdomain中创建的,还是代理另一个appdomain中的对象?

Jar*_*Par 9

请尝试以下方法

var isProxy = RemotingServices.IsTransparentProxy(obj);
Run Code Online (Sandbox Code Playgroud)

System.Runtime.Remoting.RemotingServices.IsTransparentProxy