We have a large vb6 application, and as we need to change/fix things, we are moving sections to .net, targeting the framework 2.0. We have moved a bunch of classes to a .net dll, and they are set up properly to be exposed to com.
Here's the problem: MainAppVB6.exe instantiates DOTNET_COM.ComClass. It passes this to a method in a differen .net dll, which passes it across an appdomain. This is no issue at all for COM objects written in vb6.
.net see the appdomain boundary, and wants the objects to be serializable or marshalbyref. Since we need the .net portion to change data that gets back to vb6, serializable doesn't work. If we mark the classes at Inherits MarshalByRefObject, then we get "This remoting proxy has no channel sink which means either the server has no registered server channels are listening, or the application has no suitable client channel to talk to the server".
There are no channels -- we are just going across an appdomain in the same dll. It seems that .net is not treating the object as COM, which it should be doing.
If I remove both marshalbyref and serializable, things work only if the com object is instantiated by vb6. If the .net functionality in the appdomain creates the object and assigns to to be passed back to vb6, vb6 gives me automation errors.
A very ugly kludge is to serialize the object in the new appdomain, send back the xml, and let vb6 deserialize, but that seems ridiculous.
Anyone have any ideas?
Thank you.
Seth