我创建了一个程序,它使用的插件使用卡利和.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
发布评论