在我的 MEF 应用程序中,我计划从两种方式加载模块。
一种方法是这样的。
protected override void ConfigureAggregateCatalog()
{
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(PEMDAS.ModuleInit).Assembly));
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Bootstrapper).Assembly));
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Infrastructure.ObservableCommand).Assembly));
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Security.SecurityModule).Assembly));
this.AggregateCatalog.Catalogs.Add(new AssemblyCatalog(typeof(Tests.ModuleInit).Assembly));
}
另一个将在文件夹中查找程序集。我想这可以用这两种方式。我计划先加载文件夹,然后加载ConfigureAggregateCatalog
.