AssemblyDefinition assembly = AssemblyDefinition.ReadAssembly("MyAssembly.dll"); TypeDefinition type = assembly.MainModule.Types.FirstOrDefault(t => t.Name == "MyClass"); bool isVisible = type.IsVisible;
ModuleDefinition module = ModuleDefinition.ReadModule("MyModule.netmodule"); TypeDefinition type = module.Types.FirstOrDefault(t => t.Name == "MyClass"); bool isVisible = type.IsVisible;In this example, we are using Mono.Cecil to read a module (a single file containing one or more types) and retrieve a TypeDefinition for a class named "MyClass". We again use the IsVisible property to determine whether this class is visible outside of its module. Package library: Mono.Cecil