MEF:目录部分目录
我正在尝试编写一个简单的 MEF 演示来了解它。我正在关注 这个教程,但似乎已经过时了。可下载的示例可以工作,但它使用的包含程序集比 Framwework 4 附带的当前版本 (4.0) 早 2 个版本 (2008.9.4.0)。
特别是,它使用了 DirectoryPartCatalog,我在最新库中找不到它。谁能提供一个关于如何从当前版本的 MEF 目录中发现可插入程序集的示例?
谢谢
I'm trying to write a simple MEF demo to learn about it. I'm following this tutorial, but it seems to be outdated. The downloadable example works, but it uses an included assembly that is 2 versions older (2008.9.4.0) than the current one (4.0) that ships with Framwework 4.
In particular, it uses DirectoryPartCatalog that I cannot find anywhere in the newest library. Could anyone provide an example on how to discover pluggable assemblies from a directory with the current version of MEF?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要进行一些更改才能使该示例使用 System.ComponentModel.Composition 的内置版本进行编译和运行。
You need to make several changes to make this sample compile and run with builtin version of System.ComponentModel.Composition.
DirectoryPartCatalog 现在称为 DirectoryCatalog
DirectoryPartCatalog is now called DirectoryCatalog
我认为您正在搜索 DirectoryCatalog< /a>
I think, that you are searching for DirectoryCatalog