GetType from custom class library

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm baffled, please help!! I have a class library (MyClassLib). A class in
the class library (AClass) is a simple class not derived from anything with
basic methods and properties. I need to be able to get a Type object of the
class at runtime using a string variable identifying the class, then iterate
through the properties. Here is what I've tried, but it doesn't work, t is
always nothing unless I use a system class.

Dim t As Type
Dim myClassStr as String = "MyClassLib.AClass"
t = Type.GetType(myClassStr)

Thanks for any help or guidance.
 
bingo
Brock Allen said:
You need to incorporate the assembly into the name when using Type.GetType:

Type t = Type.GetType("YourNamespace.YourClass, YourAssemblyWithoutTheFileExtension")
 
Back
Top