18 Jun 2003 osullivj   » (Journeyer)

Type.GetType: If the type is in the calling assembly, or in mscorlib.dll, a simple type name will suffice. So if we're invoking from myAssembly.myClass this will work...

Type.GetType( "myAssembly.myOtherClass");

For types in some other assembly an assembly name needs to be appended to the type name. That assembly name should be full or partial. If the assembly holding the type is in your executable directory, a partial assembly name will suffice. For instance, if you're loading anotherClass from anotherAssembly then you'll need...

Type.GetType( "anotherAssembly.anotherClass, anotherAssembly");

If the type you're attempting to load isn't in the calling assembly, mscorlib.dll, or an assembly in the executable directory you will need a full assembly name. That includes the version, culture and public key token. Here's an example for a WinForms column style...

Type.GetType( "System.Windows.Forms.DataGridTextBoxColumn, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089");

How to discover the version, culture and key token info for an assembly ? Use gacutil /l to list the global assembly cache.

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!