我使用这篇文章并在项目中创建了多个类库。我想将所有模块加载到内核中。
为了加载所有模块,我在 MainViewModel 中使用此代码
public MainViewModel()
{
IKernel kernel = new StandardKernel();
kernel.Load(AppDomain.CurrentDomain.GetAssemblies());
Plugins = kernel.GetAll<PluginBase>().ToList();
}
但不要加载模块(插件)AppDomain.CurrentDomain.GetAssemblies()