FileNotFound when load assembly with dependency to another domain

后端 未结 2 1467
陌清茗
陌清茗 2021-02-07 18:47

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

相关标签:
2条回答
  • 2021-02-07 19:08

    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.

    0 讨论(0)
  • 2021-02-07 19:27

    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.

    0 讨论(0)
提交回复
热议问题