无法创建插件实例,急
-
2012年3月28日 7:06
按照标准的注册插件的流程完成了插件的注册,是注册的account的create消息的post-event,签名了,也成功的注册了,但是创建客户并保存的时候就报错,提示“无法创建插件实例,请检查是否包含一个PUBLIC的构造器”,但即使是一个新建的没有填自定义逻辑的插件,也会报同样的错误,无法创建插件实例
不知道大家有没有碰到过这样的情况
Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Can not create instance of a plug-in. Verify that plug-in type is not defined as abstract and it has a public constructor supported by CRM SDK.Detail:
<OrganizationServiceFault xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
<ErrorCode>-2147180031</ErrorCode>
<ErrorDetails xmlns:d2p1="http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
<Message>Can not create instance of a plug-in. Verify that plug-in type is not defined as abstract and it has a public constructor supported by CRM SDK.</Message>
<Timestamp>2012-03-28T07:34:36.222682Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText i:nil="true" />
</OrganizationServiceFault>- 已编辑 MoonShadowFei 2012年3月28日 7:35
全部回复
-
2012年3月30日 13:47
你把代码贴出来,让大家能更好的帮助你,
尝试添加一个构造函数,4.0中的插件构造函数有两个string类型的参数你 你在代码中试下
windows live Id :hellohongfu@hotmail.com
- 已标记为答案 MoonShadowFei 2012年4月8日 14:07
-
2012年4月8日 9:40后来打到原因了,是因为装了ToolKit,它会自动封装,先用plugin class继承Iplugin,然后用插件的class继承plugin class,我注册插件的时候把step注册到了plugin class,而不是自己写的插件