Hola tod@s:
Estoy implementando unas pruebas con .NET Remoting y me han surgido algunos
problemas al intentar usar los delegados en los objetos de tipo
"MarshalByRefObject":
Tengo una clase llamada "Proxy" que extiende de "MarshalByRefObject".
Registro el objeto remoto de esta forma:
//Registrando el channel (HTTP) puerto 8080
ChannelServices.RegisterChannel(new HttpChannel(8080));
//Registrando ativaçà£o server-si
RemotingConfiguration.RegisterWellKnownServiceType(
typeof(Proxy), //tipo
"ProxyURI", //URI
WellKnownObjectMode.Singleton //modo
);
Luego lo utilizo:
//Registrando el channel (HTTP)
ChannelServices.RegisterChannel(new HttpChannel(0));
//Registrando el client
RemotingConfiguration.RegisterWellKnownClientType(
typeof(Proxy), //tipo
"
http://localhost:8080/ProxyURI" //URI
);
try {
//Instanciamento e invocación del objeto remot
p = new Proxy();
p.Evento += new Delegado(p_Evento);
} catch (System.Net.WebException wex) {
Console.WriteLine(wex.Message);
}
Al ejecutar la linea:
p.Evento += new Delegado(p_Evento);
Me da un error de seguridad "SecurityException", dice lo siguiente:
Type System.DelegateSerializationHolder and the types derived from it (such
as System.DelegateSerializationHolder) are not permitted to be deserialized
at this security level.
No se a que se debe, si alguien puede ayudarme a comprender el porque,
gracias.
Leer las respuestas