I have couple resource DLLs that I currently load when application starts using following code:
Assembly ass = Assembly.LoadFrom(fi.FullName); Type t = ass.GetTypes()[0]; string ns = t.Namespace; BaseFacade bf = Activator.CreateInstance(t) as BaseFacade; // bf.GoWild()...
When I have that BaseFacade I go wild with function calling to obtain resources from DLLs and all that works fine. However that initial LoadFrom is extremely slow and for 10 DLLs I have it takes over 30 seconds.
So, I was wondering of alternative approaches? Are there any? I was wondering if it is possible to do something like:
[DllImport("myResources1.dll")] public static extern void GoWild(); [DllImport("myResources2.dll")] public static extern void GoWild();
?? If it is possible, how would I expose those GoWild functions for resource DLLs? Also, how would I point application to location of DLLs considering they are not always in directory of main DLL (and user has option to move those DLLs around)?
Thanks for any advice on this subject!