Hi,
Just recently encountered a problem while building an
application with multiple domains. If I try to marshal an
object/interface from one of the non-default domains I am
unable to connect to it from another application. If the
object lives in the default domain, everything works as
it should.
The second application(client) is able to obtain a proxy
to the remote object with no problem, however the actual
connection (tcp/http) is not activated until the first
method call is made on the proxy object. This is when I
get the 'Service not found' error. Traced through the
call stack and with the help of the Rotor source code
determined that the function
System.Runtime.Remoting.Channels.BinaryServerFormatterSink
..ProcessMessage method was throwing the remoting
exception on the server side. Apparently the function
RemotingServices.GetServerTypeForUri(<uri>) was
returning 'null' indicating that it couldn't match the
URI with a registered/marshaled object. Since this method
is declared as 'private static', a copy of it exists in
each application domain, so I'm assuming that Remoting
only calls the method in the default domain when trying
to resolve a URI and the object I'm trying to connect to
is registered in another app domain. If I move the object
to the default domain, everything works as expected. I
know that remoting channels are domain specific but was
hoping that there was a workaround that didn't involve
relocating the marshaled objects.
In case you're wondering why I've got multiple app
domains - it's because they are used to host user written
plug-ins to the main application (for security/fault
isolation).
Any comments would be greatly appreciated.
Thanks,