huzige0265

导航

 

1、导出所有的程序集并且实例化

private void Compose()
{
var catalog = new AssemblyCatalog(Assembly.GetExecutingAssembly());//反射
CompositionContainer container = new CompositionContainer(catalog);
container.ComposeParts(this);
}

 

2、导出指定文件夹里面的DLL,并且实例化

private void Compose()
{
var catalog = new DirectoryCatalog("Cards");
var container = new CompositionContainer(catalog);
container.ComposeParts(this);
}

posted on 2020-03-06 10:37  huzige0265  阅读(766)  评论(0编辑  收藏  举报