Advertisement
Intermediate C# Programming, .NET Framework Fundamentals

What are Metadata and an assembly?

Short answer

An assembly is the fundamental building block of a dot NET application, typically a DLL or EXE file, that contains compiled code along with metadata describing that code, such as information about types, methods, versions, and referenced assemblies.

Save C# Programming mock interview
Advertisement
AModel answer
An assembly is the fundamental building block of a dot NET application, typically a DLL or EXE file, that contains compiled code along with metadata describing that code, such as information about types, methods, versions, and referenced assemblies. Metadata acts like a detailed blueprint embedded directly inside the assembly, allowing the Common Language Runtime and development tools to understand exactly what the assembly contains without needing any separate external description files.
// Viewing assembly metadata using reflection
var assembly = typeof(Program).Assembly;
Console.WriteLine(assembly.FullName);
Real-world example
A tool that analyzes third party dot NET libraries reads their embedded metadata to automatically discover available classes and methods, without needing the original source code or any separate documentation file.
Likely follow-ups
  • What tools can be used to inspect an assembly's metadata?
  • What is the difference between a private assembly and a shared assembly?
Related topics