gpt4 book ai didi

c# - MEF2 目录如何工作?看起来它已被删除

转载 作者:太空狗 更新时间:2023-10-29 23:23:23 25 4
gpt4 key购买 nike

我在 MEF2 上找不到任何好的例子。

我想创建一个插件目录并使用目录目录来加载导入。

我想要什么:

  1. 没有属性。使用具有约定的配置生成器
  2. 插件目录
  3. 添加 dll 后,应用程序会知道新的导出可用。

我可以只使用 CaSTLe Windsor 吗?

最佳答案

如果您指的是 MEF 的新 Windows 应用商店版本 available on nuget , 然后 the documentation州,

There is no catalog concept, nor composition batches, nor any “container hierarchy” or composition scoping APIs.

对于 MEF 1 开发人员来说听起来很疯狂,但该页面很好地解释了基本原理。但是,您需要:

  • When a dll is added the application is aware of new Exports available.

这在 MEF 2 (Win Store) 版本中明确不可用,因为它不支持重新组合。 为此,您需要来自 .NET Framework 的“完整”MEF,位于 System.ComponentModel.Composition 中。

关于c# - MEF2 目录如何工作?看起来它已被删除,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18102985/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com