Reflection C# - GetType()返回Null

时间:2013-02-05 14:48:13

标签: c# reflection null

  

可能重复:
  Type.GetType(“namespace.a.b.ClassName”) returns null

我试图按如下方式接收对象的类型:

Type type = typeof(Namespace1.SubFolder.Class);
Type type2 = Type.GetType("Namespace1.SubFolder.Class");

为什么将type2作为null返回并按预期返回类型?我希望最终从用户选择的字符串值创建一个类。

0 个答案:

没有答案
相关问题