我正在使用 .NET CF 3.5。我要创建的类型没有默认构造函数,因此我想将字符串传递给重载的构造函数。我该怎么做呢?
代码:
Assembly a = Assembly.LoadFrom("my.dll");
Type t = a.GetType("type info here");
// All ok so far, assembly loads and I can get my type
string s = "Pass me to the constructor of Type t";
MyObj o = Activator.CreateInstance(t); // throws MissMethodException