Type.GetType(QUOT; namespace.a.b.ClassName")返回null [英] Type.GetType("namespace.a.b.ClassName") returns null

查看:152
本文介绍了Type.GetType(QUOT; namespace.a.b.ClassName")返回null的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这code:

Type.GetType("namespace.a.b.ClassName")

收益

和我在usings:

using namespace.a.b;

更新:

类型的存在,它在不同的类库,我需要通过字符串名称来得到它。

The type exists, it's in a different class library, and i need to get it by string name.

推荐答案

Type.GetType(namespace.qualified.TypeName)仅在类型中找到工作无论是mscorlib.dll中或当前执行的程序集。

Type.GetType("namespace.qualified.TypeName") only works when the type is found in either mscorlib.dll or the currently executing assembly.

如果没有这些东西都是真实的,你需要一个<一个href=\"http://msdn.microsoft.com/en-us/library/system.type.assemblyqualifiedname.aspx\">assembly-qualified命名。

If neither of those things are true, you'll need an assembly-qualified name.

这篇关于Type.GetType(QUOT; namespace.a.b.ClassName&QUOT;)返回null的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆