Error when adding user-defined control to a form.

2019-08-31 01:30发布

问题:

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[]"

回答1:

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

if(!DesignMode)
{
     //Do something
}


回答2:

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.