Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect a transparent proxy vs actual object reference?

Tags:

c#

.net

remoting

Given an object reference, is it possible to programmatically determine if the object was created in the current appdomain or instead is a proxy to an object in another appdomain?

like image 834
redman Avatar asked Jan 06 '10 22:01

redman


1 Answers

Try the following

var isProxy = RemotingServices.IsTransparentProxy(obj);

System.Runtime.Remoting.RemotingServices.IsTransparentProxy

like image 200
JaredPar Avatar answered Oct 12 '22 23:10

JaredPar