- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
出于沮丧和超过 3 天的谷歌搜索这个问题......我别无选择,只能用我的问题来打扰你们。
我正在创建一个 Silverlight 应用程序。我正在使用 MEF。当我尝试运行我的应用程序时,出现以下错误。
The invocation of the constructor on type 'IFG.Silverlight.Client.Views.MenuView' that matches the specified binding constraints threw an exception. [Line: 25 Position: 47]
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 valid exports were found that match the constraint '((exportDefinition.ContractName == "MenuViewModel") AndAlso (exportDefinition.Metadata.ContainsKey("ExportTypeIdentity") AndAlso "IFG.Silverlight.Client.ViewModel.MenuViewModel".Equals(exportDefinition.Metadata.get_Item("ExportTypeIdentity"))))', invalid exports may have been rejected.
Resulting in: Cannot set import 'IFG.Silverlight.Client.Views.MenuView.ViewModel (ContractName="MenuViewModel")' on part 'IFG.Silverlight.Client.Views.MenuView'. Element: IFG.Silverlight.Client.Views.MenuView.ViewModel (ContractName="MenuViewModel") --> IFG.Silverlight.Client.Views.MenuView
namespace IFG.Silverlight.Client.Common
{
public interface IRetailModel
{ ............
namespace IFG.Silverlight.Client.Model
{
[Export(typeof(IRetailModel))]
public class RetailModel : IRetailModel
{ .................
namespace IFG.Silverlight.Client.ViewModel
{
[PartCreationPolicy(CreationPolicy.NonShared)]
[Export(ViewModelTypes.MenuViewModel)]
public class MenuViewModel : IFGViewModelBase
{
IRetailModel _model;
[ImportingConstructor]
public MenuViewModel(IRetailModel model)
{
Error: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
最佳答案
为将来引用,Visual Mefx 的更新版本附在此博客文章中:How to Debug and Diagnose MEF Failures .它也是 MEFContrib 的一部分,尽管我不确定 MEFContrib 版本是否具有博客文章中版本的所有更改。
关于mvvm - Silverlight 4,MEF,导出/导入错误,Mefx 不想工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4441694/
出于沮丧和超过 3 天的谷歌搜索这个问题......我别无选择,只能用我的问题来打扰你们。 我正在创建一个 Silverlight 应用程序。我正在使用 MEF。当我尝试运行我的应用程序时,出现以下错
我是一名优秀的程序员,十分优秀!