MissingMethodException - Caliburn

2019-08-03 02:24发布

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条回答
够拽才男人
2楼-- · 2019-08-03 02:35

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.

查看更多
登录 后发表回答