Ok,

I've been quite successful on my own building a plugin framework that
appears to be working quite well. I can manually unload/reload etc,
however, the original app domain is retaining a lock on the shadowcopied
assembly. I've done a fair ammount of research before resorting to this.

My model is like the following.

------------- -------------- ---------------
PluginLoader RemoteLoader MyPlugin:IPlugin
------------- -------------- ---------------
plugincollection LoadPlugins
LoadPlugins

Basically, I instantiate a plugin loader which creates a new appdomain
with setup info for shadow copying etc. It instantiates remoteloader
with a plugin path.

LoadPlugins on PluginLoader calls LoadPlugins which returns a
IPluginCollection which is a collection of instantiated types etc.

I beleive my problem is that because I set a local var in my app to
return value from pluginLoader.LoadPlugins that its hanging on to the
original files.

How could I remedy this situation? I'd like to be able to
delete/overwrite dlls on the fly. How do you guys do it?

Thanks in advance
Weston Weems

Re: AppDomain Shadow copy and plugin framework models PLEASE HELP! =0 by Dmytro

Dmytro
Fri Feb 24 06:25:26 CST 2006

Hi Weston,

You can probably consider using weak references.

"Weston Weems" <wweems@NO_spamerino.gmail.com> wrote in message
news:uucVmIzNGHA.2528@TK2MSFTNGP12.phx.gbl...
> Ok,
>
> I've been quite successful on my own building a plugin framework that
> appears to be working quite well. I can manually unload/reload etc,
> however, the original app domain is retaining a lock on the shadowcopied
> assembly. I've done a fair ammount of research before resorting to this.
>
> My model is like the following.
>
> ------------- -------------- ---------------
> PluginLoader RemoteLoader MyPlugin:IPlugin
> ------------- -------------- ---------------
> plugincollection LoadPlugins
> LoadPlugins
>
> Basically, I instantiate a plugin loader which creates a new appdomain
> with setup info for shadow copying etc. It instantiates remoteloader with
> a plugin path.
>
> LoadPlugins on PluginLoader calls LoadPlugins which returns a
> IPluginCollection which is a collection of instantiated types etc.
>
> I beleive my problem is that because I set a local var in my app to return
> value from pluginLoader.LoadPlugins that its hanging on to the original
> files.
>
> How could I remedy this situation? I'd like to be able to delete/overwrite
> dlls on the fly. How do you guys do it?
>
> Thanks in advance
> Weston Weems