的MissingMethodException - 卡利 [英] MissingMethodException - Caliburn

查看:178
本文介绍了的MissingMethodException - 卡利的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个程序,它使用的插件使用卡利和.NET 4。

I have created a program that uses plugins using Caliburn and .NET 4.

在创建插件,容器,窗口管理器,和一个视图模型工厂的实例使用卡利的能力被注入。

When creating an instance of the plugin, a container, window manager, and a view-model factory is injected using caliburn's abilities.

然而,运行包含注入的属性之一的使用的code的时候,我收到了

However, when a code containing usage of one of the injected properties is run, I get a

的MissingMethodException

MissingMethodException

。这是推动我疯了。

另外,如果插件实例有需要被满足的依赖关系(如的IContainer,并IWindowManager),这是默认的卡利注册的,它无法与没有这种成分被发现在IoC容器消息创建它。

Also, if the plugin instance has dependencies that need to be satisfied (like IContainer, and IWindowManager) which are registered by default in Caliburn, it fails to create it with the message that no such components were found in the IoC container.

在调试模式下我检查了,一切都被注册,所以我不知道该怎么办。

In debug mode I checked and everything is registered so I don't know what to do.

你觉得可能是这个问题?

What do you think could be the problem?

推荐答案

关于的MissingMethodException ,确保在XAML的签名相匹配的方法的。

Regarding the MissingMethodException, make sure the signature in the XAML matches the method's.

例如,这在XAML:

<DockPanel cal:Message.Attach=" [Event KeyDown] = [Action KeyDown($eventArgs)]">

匹配这个方法:

Matches this method:

public void KeyDown(KeyEventArgs args)
{
//stuff
}

如果您删除 $ EventArgs的位,你会得到一个异常。

If you remove the $eventArgs bit you will get an exception.

这篇关于的MissingMethodException - 卡利的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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