How should I load assemblies across the application domain boundary to load and unload modules?
I'm aware of the limitations of loading an assembly dynamically during run-time that prevents it from being unloaded. Instead it's been suggested that, if this is a requirement, that I should instead load modules in other application domains and then execute code across the domain bound开发者_如何学Pythonries.
How can I ease this development process and work with this scenario? What tools or frameworks are available?
Does MEF [1] send you in the right direction? Or you could go with Castle Windsor [2], though I've not had a need to unload with either.
[1] http://code.msdn.microsoft.com/mef
[2] http://www.castleproject.org/container/index.html
It depends on how complicated the interaction is between your "host" app and the dynamically loaded code. If it is fairly complicated then you may want to go the full System.AddIn route. If your interactions are fairly simple then you should probably just write your own classes to handle the loading and unloading of the assemblies. I've done this a number of times for various smaller projects so I can post code if that would be helpful.
精彩评论