Let me try to explain my problem. I am currently trying to develop a small “plugin framework” written in .Net (mainly for experimentation). Therefore, the idea is to have a main application to which you can add “plugins” by deploying a DLL in a specific “plugins” folder of the main application. Everything works fine, plugins are created correctly, but now I am faced with a problem. Now I have deployed the “X” plugin, which uses additional third-party plugins, and now I have a problem that these additional third-party plugins required by “X” were not found at runtime. My idea is now to add additional “dependencies” to the directory, where I also deploy all the necessary plugins.
So, my first question is: How can I upload assemblies to the application domain (given that I know the path to them) st can they be used by my application?
I tried to approach this by doing something like:
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); System.Reflection.Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { //find the path to the assembly and then load and return it by //return Assembly.Load("pathToDependencies/failedAssembly.dll"); }
The problem is that this event handler is now activated using "Presentation.Zune.dll" in the args variable (I am using a WPF application). It seems that the build failed, but another dll is the actual problem.
Can someone suggest me a better way to solve my problem? I hope that I was able to explain my situation in sufficient detail, otherwise I’ll just ask for further clarification.
Thanks, Juri
source share