How to solve \"Must be MarshalByRefObject\" in a good but multiple-inheritance amputated language like C#?
The problem is very simple, in several cases you just have
I had success with a generic approach. T doesn't have to be "MarshalByRefObject". Of course you'll have to replace "RemoteProcess" with the object you use for remoting. Then you can access your non-MarshalByRefObject as RemotingHost.RemoteObject.
public class RemotingHost : MarshalByRefObject where T: class
{
RemoteProcess host;
T remoteObject;
public T RemoteObject { get { return remoteObject; } }
public RemotingAdmin()
{
host = new RemoteProcess();
remoteObject = (T)host.CreateObject(typeof(T));
}
}