Home All Groups Group Topic Archive Search About

Async Remoting causes unexpected Serializable requirements

Author
7 Sep 2006 3:09 AM
hellosticky
I have used .NET remoting for some time now calling a synchronous
method and getting the result (which has the Serializable attribute).
Recently, I changed it to asynchronous, and when I call EndInvoke on
the delegate, it throws a not Serializable exception on a class that is
instantiated on the other side, which is not even returned in the
function call. For example, the class that I remote may looks like
this:

class RemoteableProvider
{
  public RenderedContent Render()
  {
    IContentProvider provider = Assembly.LoadFrom(...);
    return provider.Render();
  }
}

Now, I am asynchronously calling Render on a RemoteableProvider
instance. Before, it would return the RenderedContent object no
problem. Now, the class of the IContentProvider which is dynamically
loaded in the server is required to be [Serializable]. How can I avoid
this (I can't just make it Serializable, as you'll notice, I'm
dynamically loading 3rd party plugins).

Thank you

AddThis Social Bookmark Button