using System; public class Program { public static void Main() { Type[] types = typeof(Program).Assembly.GetTypes(); foreach(var type in types) { Console.WriteLine($"Type: {type.Name}"); } } }
using System; using System.Reflection; public class Program { public static void Main() { Assembly assembly = Assembly.LoadFile(@"C:\path\to\assembly.dll"); Type[] types = assembly.GetTypes(); foreach(var type in types) { Console.WriteLine($"Type: {type.Name}"); } } }This program loads an external assembly and prints the name of all types in it. Package/library: System.Reflection.