如果你的类不是在当前的装配件中定义的或者定义该类的装配件不是全局装配件,你需要先Load定义该类的装配件,Like:System.Reflection.Assembly a = System.Reflection.Assembly.Load("你的装配件的名称"); Type tt = a.GetType("topNamingSpace.subNamingspace.className");
to timmy3310 File or assembly name 装备件名称, or one of its dependencies, was not found,找不到哦,是什么原因呢?
你可以看看Type.GetType是什么
得到的type名和我给他的是一样的
Type tt = a.GetType("topNamingSpace.subNamingspace.className");
File or assembly name 装备件名称, or one of its dependencies, was not found,找不到哦,是什么原因呢?
最好是把你的dll放到当前项目的bin目录下
或者
用regsvcs将你的装配件注册到全局参考
ms-help://MS.VSCC/MS.MSDNVS.2052/cptools/html/cpgrfnetservicesinstallationutilityregsvcsexe.htm
或者
typeof(topNamingSpace.subNamingspace.className);
其中,yourAssemblyName是去掉后缀名的Dll文件名。