Thank you Nicholas, that example was very helpful. I now have the
system up and working. Though the event repeater being created by the
client and then remoted to the server works, the whole system would be
so much cleaner if the clients could subscribe to events of the server
object directly. Does anyone know if this will change with whidbey?
-Dan
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:<eF**************@TK2MSFTNGP12.phx.gbl>...
Dan,
Check out the article on CodeProject.com titled ".NET Remoting: Passing
through the obstacles path from version 1.0 to 1.1", which details how to
deal with this issue (it consists mainly of setting the type filter level on
the client and server). It is located at (watch for line wrap):
http://www.codeproject.com/csharp/Pa...ingArticle.asp
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com
"Dan" <da**************@srs.gov> wrote in message
news:45**************************@posting.google.c om... 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(hubListenerConnecti on_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