I have written a custom remoting formatter sink for an established application. The formatter appears to work for most cases until I try to use it to call a remote method to which I pass a call-back to a CAO. At this point I get a SerializationException indicating that I am trying to serialise the CAO, which is obviously not what I want to do. The CAO inherits from MBRO and object lifetimes do not come into play at this stage.
Does anyone know how I can serialise the incoming IMessage in my formatter in such a way as to preserve the reference to the CAO? I assume that I need to walk the object graph, converting the CAO to an ObjRef which can then be serialised but my problem is more fundamental as I do not have a concrete 'Message' to serialise, only an IMessage. I would prefer not to use reflection.
I am aware of WCF, but do not wish to migrate to it at this stage as the application is quite large.