开发者

MEF container auto-update using a directory-catalog

This is possible if we manually create a FileSystemWatcher and watch the 'parts' directory (here some dlls inside the folder) and track any chan开发者_如何学运维ges, then we reflect the changes into a container which allows for recomposition.

Does MEF support auto-updating when the Container is using a DirectoryCatalog and it automatically for us ?


You need to call the Refresh method of the DirectoryCatalog for it to update with new contents. This will trigger recomposition in any containers hooked up to the catalog. You can create a FileSystemWatcher and call the Refresh method when anything changes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜