D
Dan
I am having a problem trying to assign event handlers to the events of
a remoted object. I have one program that registers the object for
remoting, Another that connects and calls methods on the object and a
third that connects to the object and waits for events. The error
occurs when I try to assign event handlers to the remoted object's
events in the third program (Listener).
hubListenerConnection.ContextRequest += new
Hub.ContextRequestEventHandler(hubListenerConnection_ContextRequest);
This line throws a System.Security.SecurityException
Additional information: Type System.DelegateSerializationHolder and
the types derived from it (such as System.DelegateSerializationHolder)
are not permitted to be deserialized at this security level.
The Hub (inherits MarshalByRefObject) object events are declared as
follows:
public delegate void ContextRequestEventHandler(object sender,
EventArgs.ContextRequestEventArgs e);
public event ContextRequestEventHandler ContextRequest;
protected virtual void
OnContextRequest(EventArgs.ContextRequestEventArgs e)
{
if (ContextRequest != null)
{
ContextRequest(this, e);
}
}
The custom EventArgs are declared with [Serializable] as is the
listener.
Any help with what I am doing wrong to get this error and what I can
do to make this system work?
Thanks,
Dan
a remoted object. I have one program that registers the object for
remoting, Another that connects and calls methods on the object and a
third that connects to the object and waits for events. The error
occurs when I try to assign event handlers to the remoted object's
events in the third program (Listener).
hubListenerConnection.ContextRequest += new
Hub.ContextRequestEventHandler(hubListenerConnection_ContextRequest);
This line throws a System.Security.SecurityException
Additional information: Type System.DelegateSerializationHolder and
the types derived from it (such as System.DelegateSerializationHolder)
are not permitted to be deserialized at this security level.
The Hub (inherits MarshalByRefObject) object events are declared as
follows:
public delegate void ContextRequestEventHandler(object sender,
EventArgs.ContextRequestEventArgs e);
public event ContextRequestEventHandler ContextRequest;
protected virtual void
OnContextRequest(EventArgs.ContextRequestEventArgs e)
{
if (ContextRequest != null)
{
ContextRequest(this, e);
}
}
The custom EventArgs are declared with [Serializable] as is the
listener.
Any help with what I am doing wrong to get this error and what I can
do to make this system work?
Thanks,
Dan