[Mono-dev] Cross-Appdomain remoting

Michael Mudge michael at mudge.com
Fri May 6 14:18:16 EDT 2011

Ah!  The idea of changing the lifetime was enough info for me to find the cause.

Hm, I could swear I saw a difference in behavior between .NET and
Mono, but my simplified test case revealed an identical error (with
slightly different text) in .NET - that led me to

I overrode InitializeLifetimeService on the MarshalByRef objects and
returned null - this prevents the objects from expiring.  Thanks for
the reply!

- Kipp

On Thu, May 5, 2011 at 4:49 PM, Robert Jordan <robertj at gmx.net> wrote:
> Hi,
> On 05.05.2011 22:11, Michael Mudge wrote:
>> I'm seeing strange behavior on our device - AppDomain A has launched
>> AppDomain B, and wired the DomainUnloaded event.  I'm seeing that
>> RemotingServices.DisposeIdentity is being called after 5 minutes, and
>> then when AppDomain B unloads itself and the unload event is fired, I
>> get this error:
>> Unhandled Exception: System.Runtime.Remoting.RemotingException: Server
>> for uri '6c9364e7_bf92_4f6d_950d_9cfc5c9a372d/b4c91032_2.rem' not
>> found
>> Server stack trace:
>>    at System.Runtime.Remoting.Proxies.RealProxy.GetAppDomainTarget ()
>> [0x00000] in<filename unknown>:0
>>    at (wrapper xdomain-dispatch)
>> Manager.Shells.WAppServer:HandleDomainUnload
>> (object,byte[]&,byte[]&,string)
>> I *think* that the problem is that the domain unload can't find A.
>> I *think* that the object that can't be found is supposed to be
>> automatically recreated - am I right?  If that's true, I'm guessing
> The proxy won't be recreated. If you want to prevent it from
> being disposed, you should either change its lifetime (via
> app.config's <system.runtime.remoting> element) or call/poll
> a method periodically.
>> that this can't be done when an AppDomain is being unload...  Is that
>> true?  Where should I start looking to solve this?  Can someone
>> provide a clearer explanation of how this all works?
> Please explain first (preferably with code) what you're trying
> to achieve.
> Robert
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list

More information about the Mono-devel-list mailing list