Hi all.
Here is description of my run-time assembly loading problem:
I would like to have winService hosting .Net remoting objects.
But, it should work in sort of pluginable way, so during starting of winService it would look into certain folder configured with App.config and dynamically load assemblies from deployed dll-s. Registering of remote objects would be done in some AddonXXX: IAddonXXX class that is defined in each dll, and some mutual interface IAddonXXX would be used to identify those addon classes after assembly is loaded in run-time.
This all sound ok, but now I have encounter following problem.
Naturally, my plugin dll references some other dlls, and after loading of assembly when addonAssembly.GetExportedTypes is executed I keep getting this error:
"Could not load file or assembly 'DALXXXModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."
I tried pretty much all I though it could make a difference.
System.Reflection.Assembly.Load
AppDomain.CurrentDomain.Load
even I deployed all referenced dlls and load them in order that first are loaded referenced dlls and plugin dll at the end, but error remains same.
So, my question is:
What is correct way to load dll at runtime? And I would prefer if dll should not be stored in GAC.
So, somehow I suppose that this should be common thing to do and there is probably right way to do this... Can anybody help me? Tnx.