【问题标题】:Error : No exports were found that match the constraint:错误:未找到与约束匹配的导出:
【发布时间】:2014-03-30 19:24:19
【问题描述】:

我正在构建一个 WAF 项目。当我调试我的项目时。我遇到了这个问题

"The composition produced a single composition error. The root cause is provided below.
 Review the CompositionException.Errors property for more detailed information.\r\n\r\n1) 
 No exports were found that match the constraint: \n\tContractName\tWaf.InformationManager.OneNote.Modules.Applications.Views.INoteView\n\t
 RequiredTypeIdentity\tWaf.InformationManager.OneNote.Modules.Applications.Views.INoteView\r\n"

我该如何解决这个问题?

我解决了我的问题(感谢 sgrassie) 我没有创建 NoteView.xaml(它实现了 INoteView 并在类头添加 [Export(typeof(INoteView)] )

【问题讨论】:

  • 如果我已经回答了您的问题,您应该将我的回答标记为已接受。

标签: c# attributes mef waf


【解决方案1】:

您在实现INoteView 的类上缺少[Export(typeof(INoteView)] 属性。

【讨论】:

  • 是的。多谢兄弟。这行得通。我没有创建 NoteView.xaml(它实现了 INoteView,当然还有 [Export(typeof(INoteView)] at class header )。我会更新我的问题,喜欢这个问题
  • 在过去的 3 天里,我一直在努力解决这个问题。你是我的救星。非常感谢:)
猜你喜欢
  • 2017-03-06
  • 2022-10-06
  • 2014-07-13
  • 1970-01-01
  • 2013-10-13
  • 2014-02-17
  • 2013-07-09
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多