Home All Groups Group Topic Archive Search About

AppDomain Shadow copy and plugin framework models PLEASE HELP! =0

Author
21 Feb 2006 9:58 PM
Weston Weems
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

Author
24 Feb 2006 12:25 PM
Dmytro Lapshyn [MVP]
Hi Weston,

You can probably consider using weak references.

Show quote
"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

AddThis Social Bookmark Button