/// <summary>
/// 装载dll程序集。
/// </summary>
/// <param name="obj">装载的对象中的属性</param>
/// <param name="path">装载的对象的路径</param>
public void GetCatalogs(object obj, string path)
{
var catalog = NewInstance.CreateNew<AggregateCatalog>();
catalog.Catalogs.Add(new DirectoryCatalog(path));
var container = new CompositionContainer(catalog);
//container.ComposeParts(obj);
var composeBach = new CompositionBatch();
composeBach.AddPart(obj);
container.Compose(composeBach);
}
MEF装载dll
最新推荐文章于 2017-05-25 13:39:12 发布