Chapter 12. Assemblies

An assembly is a logical package (similar to a DLL in Win32) that consists of a manifest, a set of one or more modules, and an optional set of resources. This package forms the basic unit of deployment and versioning, and creates a boundary for type resolution and security permissioning.

Elements of an Assembly

Every .NET application consists of at least one assembly, which is in turn built from a number of three basic elements: a manifest, modules, and resources.

The manifest contains a set of metadata that describes everything the runtime needs to know about the assembly. This information includes:

  • The simple name of the assembly

  • The version number of the assembly

  • An optional originator public key and assembly hash

  • The list of files in the assembly, with file hashes

  • The list of referenced assemblies, including versioning information and an optional public key

  • The list of types included in the assembly, with a mapping to the module containing the type

  • The set of minimum and optional security permissions requested by the assembly

  • The set of security permissions explicitly refused by the assembly

  • Culture, processor, and OS information

  • A set of custom attributes to capture details such as product name, owner information, etc.

Modules are Portable Executable (PE) files that contain types described using metadata and implemented using MSIL. Additionally, modules have module manifests that define the external assemblies they are dependent on.

Resources contain nonexecutable ...

Get C# in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.