¿Cómo puedo saber si una instancia es un proxy MarshalByRef?
-
20-09-2019 - |
Pregunta
Sé que hay una manera, sé que he hecho (mucho tiempo) antes, pero no puedo recordar o averiguar cómo hacerlo !!!
var otherDomain = AppDomain.Create("Lol my memory sucks");
var myRemotableType = typeof(MyTypeThatExtendsMBRO);
var proxy = otherDomain
.CreateInstanceAndUnwrap(
type.Assembly.FullName,
type.FullName);
// how do you do this next step???
bool isProxy = IsYouIsOrIsYouAintAProxy(proxy);
Solución
Creo que usted está buscando el método RemotingServices.IsTransparentProxy()
.
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow