本文介绍了使用MEF时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用MEF作为项目的一部分时遇到错误。



可能是什么问题?







构图保持不变。由于以下错误,更改被拒绝:

组合产生单个组合错误。根本原因如下。查看CompositionException.Errors属性以获取更多详细信息。



1)未找到符合约束条件的导出:

ContractName SimpleCalculator3.ICalculator

RequiredTypeIdentity SimpleCalculator3.ICalculator



导致:无法设置导入'SimpleCalculator3.Program.calculator(ContractName =SimpleCalculator3.ICalculator)'部分'SimpleCalculator3.Program'。

元素:SimpleCalculator3.Program.calculator(ContractName =SimpleCalculator3.ICalculator) - > SimpleCalculator3.Program

解决方案

I am getting below Error while using MEF as a part of my project.

What Could be the issue?



The composition remains unchanged. The changes were rejected because of the following error(s):
The composition produced a single composition error. The root cause is provided below. Review the CompositionException.Errors property for more detailed information.

1) No exports were found that match the constraint:
ContractNameSimpleCalculator3.ICalculator
RequiredTypeIdentitySimpleCalculator3.ICalculator

Resulting in: Cannot set import 'SimpleCalculator3.Program.calculator (ContractName="SimpleCalculator3.ICalculator")' on part 'SimpleCalculator3.Program'.
Element: SimpleCalculator3.Program.calculator (ContractName="SimpleCalculator3.ICalculator") --> SimpleCalculator3.Program

解决方案


这篇关于使用MEF时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 01:19