Load a .DLL file and access methods from class within?

Use Assembly.GetTypes() to get a collection of all the types, or Assembly.GetType(name) to get a particular type.

You can then create an instance of the type with a parameterless constructor using Activator.CreateInstance(type) or get the constructors using Type.GetConstructors and invoke them to create instances.

Likewise you can get methods with Type.GetMethods() etc.

Basically, once you’ve got a type there are loads of things you can do – look at the member list for more information. If you get stuck trying to perform a particular task (generics can be tricky) just ask a specific question an I’m sure we’ll be able to help.

Leave a Comment