Error when adding user-defined control to a form.

2019-08-31 01:17发布

I have an user-defined control which includes a property ElementList of IList<WFParament> type. When I add my control into a form, I get the error:

"WorkFlowDesign.WFParament[]" can't be transfered into "WorkFlowDesign.WFParament[]"

2条回答
别忘想泡老子
2楼-- · 2019-08-31 01:35

I would verify that you don't have two versions of the assembly containing the type WorkFowDesign.WFParament loaded/referenced. This could happen if your project where you are using the user control references one version of the assembly while the user defined control is compiled against a different version. If this is the case you will need to update one of the two so that they are referencing the same version of the assembly containing WorkflowDesign.WFParament.

查看更多
贼婆χ
3楼-- · 2019-08-31 01:56

Does your usercontrol do anything on load? If so, try wrapping it in:

if(!DesignMode)
{
     //Do something
}
查看更多
登录 后发表回答