开发者

adding exported parts to an exisiting MEF container

Is there a way to add exported parts from a catalog to an existing MEF CompositionContainer? I'm aware of ComposeExportedValue extension method, but what if I wanted to add a 开发者_StackOverflowwhole DirectoryCatalog to the list of exports? I don't need recomposition in this case, btw.


You can call DirectoryCatalog.Refresh to pick up new assemblies in a folder. To add entirely new catalogs, you could pass an AggregateCatalog to the container and then call .Add on AggregateCatalog.Catalogs.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜