Search code examples
c#reflectionmanifest.net-assembly

AssemblyInfo without loading


Is there a way to get the assembly information (name, description, version) programmatically (in C#) without loading the classes into the AppDomain? I just need the information from the manifest and nothing else. Is Assembly.ReflectionOnlyLoad(..) what I need? Or does it load the classes, too?

For Example: I have a dictionary with Files and I want to list the assembly names, descriptions and versions. I don't want to use these Assemblies at this point.


Solution

  • You're looking for AssemblyName.GetAssemblyName method which returns an AssemblyName instance. It has Name, Version, PublicKey and some basic information about the assembly.