FileNotFound when load assembly with dependency to another domain

后端 未结 2 1462
陌清茗
陌清茗 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.

提交回复
热议问题