[Mono-list] Workaround for AppDomain.Load + Unload problem?
A Rafael D Teixeira
Wed, 27 Aug 2003 21:06:18 -0300
>From: Miguel de Icaza <email@example.com>
>To: Jörg Rosenkranz <firstname.lastname@example.org>
>Subject: Re: [Mono-list] Workaround for AppDomain.Load + Unload problem?
>Date: 27 Aug 2003 18:08:23 -0400
> > We are creating an application which should be able to load and
> > unload assemblies at runtime to update parts of it dynamically.
> > To unload an assembly you have to unload the AppDomain which
> > is running it. Now there is a problem in loading and unloading
> > AppDomains:
> > http://bugzilla.ximian.com/show_bug.cgi?id=47659
> > Has someone done something similar and got around this problem?
> > Is there maybe any workaround?
>.NET does not support unloading assemblies. It is not an easy problem
>to fix (neither in .NET nor in Mono).
That´s is why most auto-updating solutions, use the
AppDomain.ShadowCopyFiles property, that makes the appdomain copy all the
files that are needed to be loaded to a shadow directory, and load them from
there, leaving the original files available to be superseded. The biggest
problem is that you one of two choices: if you want to guarantee the user is
running the latest version always, you need to wait for all assemblies being
updated before entering the main program (in that case you may not even use
ShadowCopyFiles), or the update occurs in the background but the user will
view it reflected only the next time it enters the application.
Good Hacking Habits,
Mono Hacker since 16 Jul 2001
>Mono-list maillist - Monoemail@example.com
MSN Messenger: instale grátis e converse com seus amigos.