using System; using System.Reflection; // Load the assembly Assembly assembly = Assembly.LoadFrom("MyAssembly.dll"); // Get the module Module module = assembly.GetModule("MyAssembly.Module1"); // Get all types in the module Type[] types = module.GetTypes(); foreach (Type type in types) { Console.WriteLine(type.FullName); }
using System; using System.Reflection; // Load the assembly Assembly assembly = Assembly.LoadFrom("MyAssembly.dll"); // Get the module Module module = assembly.GetModule("MyAssembly.Module1"); // Get the assembly that contains the module Assembly containingAssembly = module.Assembly; Console.WriteLine(containingAssembly.FullName);This example shows how to retrieve the assembly that contains a specific module. The System.Reflection RuntimeModule class is part of the System.Reflection namespace and is included in the .NET Framework Class Library.