MissingMethodException - Caliburn

十年热恋 提交于 2019-12-24 13:09:52

问题


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.

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

MissingMethodException

. It is driving me crazy.

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?


回答1:


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

For example, this in the XAML:

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

Matches this method:

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

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



来源:https://stackoverflow.com/questions/8914090/missingmethodexception-caliburn

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!