To load an assembly and then get a list of all types:
Assembly assembly = Assembly.ReflectionOnlyLoadFrom("System.Core.dll");
Type[] types = assembly.GetTypes();
Unfortunately this will throw an exception if any of the types exposed cannot be loaded, and sometimes this load failure cannot be avoided. In this case however the thrown exception contains a list of all types that were successfully loaded and so we can just do this:
Assembly assembly = Assembly.ReflectionOnlyLoadFrom("System.Core.dll");
Type[] types;
try
{
types = assembly.GetTypes();
}
catch (ReflectionTypeLoadException ex)
{
types = ex.Types;
}
This will give you a list of all types, including interfaces, structs, enums etc... (If you want just the classes then you can filter that list).