Activator.CreateInstance can't find the constructor (MissingMethodException)

后端 未结 9 2266
一个人的身影
一个人的身影 2021-02-18 15:55

I have a class which has the following constructor

public DelayCompositeDesigner(DelayComposite CompositeObject)
{
    InitializeComponent();

    compositeObjec         


        
9条回答
  •  情话喂你
    2021-02-18 16:39

    I would think that your call would need to be:

    var designer = Activator.CreateInstance(designerAttribute.Designer, new object[] { new DelayComposite(4) });
    

    Unless, of course, it is that, in which case the answer is not immediately obvious.

提交回复
热议问题