的MissingMethodException

编程入门 行业动态 更新时间:2024-10-10 05:22:05
本文介绍了的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

本文发布于:2023-11-12 13:02:36,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1581573.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:MissingMethodException

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!