Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以有一个插件管道 (MEF) 但根据插件类类型执行不同的功能?
示例:如果我有用于报告的加载项(每个加载项执行专门的报告功能)和用于计算的加载项(每个加载项对应用程序的不同部分执行不同的计算),有没有办法将其设置在一个管道中?或者我是否必须为我希望加载项支持的每个功能设置一个单独的管道?
您应该真正查看 MEF 文档,是的,您可以通过一个管道(组合)拥有多个加载项。查找具有 MEF [ImportMany] 属性的示例。