I\'m trying to make application with plugins.
I have MainLib.dll, where I made some commnon interface(let it be ICommon
) with 1 method. Then, I made 2 .dlls
You may want to tell the domain where to load your assemblies from:
AppDomain domain = AppDomain.CreateDomain("tmpDomain", null, new AppDomainSetup { ApplicationBase = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Plugins") });
However, I don't see why you are loading assemblies in current (default) domain and also the tmpDomain.
you don't specify how you're setting up your search paths for your AppDomains so that it can find the DLLs in the Plugins directory, however your problem sounds like it might be very similar to this one I answered yesterday:
AppDomain.Load() fails with FileNotFoundException
Perhaps this also will resolve your issue? Let me know how you get on.