I have a small software application where i have some plugins in the form of .zip files i download to a folder called “plugins”, this is my sample disc structure:
MyApplication.exe
|
|
|-Plugins (Folder)
|
|- Plugin1 (Folder)
| |
| |- MyPluginAssembly1.dll
|
|- Plugin2 (Folder)
|
|- MyPluginAssembly1.dll
|- Assembly1.dll
|- Assembly2.dll
My problem is that i have this plugin (Plugin2) which has some assemblies it need to load. Problem is that it will not work if the assemblies are located in the plugins folder the .exe which is loading the plugin cannot load the assemblies unless they are registered or resides “beside” the .exe file. Right now i copy the assemblies (Assembly1, Assembly2) to the folder which contains the .exe assembly. Is there any way i can keep the files inside the plugin folder where they belong?
You can attach to
AssemblyResolveevent and load your assemblies from any path you like.