MEF没有加载扩展名dll [英] MEF not loading the extension dll

查看:100
本文介绍了MEF没有加载扩展名dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在开展我的第一个MEF项目。我创建了2个类型为IContactTool的导出,它们在不同的项目中但与我的主应用程序在同一解决方案中。这些导出被编译到相同的dll中,我可以在我的主应用程序中导入它们。

I am working on my first MEF project. I created 2 exports of type IContactTool which are in different project but in same solution as my main application. These exports are complied into same dll and I am able to import these in my main application.

问题是我使用相同的合同IContactTool的新扩展,它是在新的项目中同样的解决方案。我的应用程序正在从第一个dll加载 导出,但它不是从第二个dll加载导出。扩展项目
在同一位置编译,我的应用程序仍未加载2ne导出?

The problem is I a new extension using same contract IContactTool which is in a new project in same solution. MY application is loading the exports from 1st dll but its not loading the export from 2nd dll. Both the extension project compiles at same location, still my application is not loading the 2ne export?

以下是导入扩展名的代码

Following is the code for Importing the extensions

[ImportMany(typeof(IContactTool))]
$
public IEnumerable< IContactTool> ContactTools {get;组; }

[ImportMany(typeof(IContactTool))]
public IEnumerable<IContactTool> ContactTools { get; set; }

这可能是什么原因?

任何帮助都非常感谢。很多,谢谢!

Any help is really appreciated. Many Thanks!

 

推荐答案

有很多事情可能是错误。  阅读关于此主题的博文,了解可能导致问题的类型以及如何诊断和修复它们:

如何调试和诊断MEF故障

谢谢,<
Daniel

Thanks,
Daniel


这篇关于MEF没有加载扩展名dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆