.Net Runtime Library for Delphi
Close
Programming with Assemblies

Assemblies are the building blocks of .NET Framework applications; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. An assembly provides the common language runtime with the information it needs to be aware of type implementations. To the runtime, a type does not exist outside the context of an assembly.

An assembly performs the following functions:

  • It contains code that the common language runtime executes. Microsoft intermediate language (MSIL) code in a portable executable (PE) file will not be executed if it does not have an associated assembly manifest. Note that each assembly can have only one entry point (that is, DllMain, WinMain, or Main).

  • It forms a security boundary. An assembly is the unit at which permissions are requested and granted. For more information about security boundaries as they apply to assemblies, see Assembly Security Considerations.

  • It forms a type boundary. Every type's identity includes the name of the assembly in which it resides. A type called MyType that is loaded in the scope of one assembly is not the same as a type called MyType that is loaded in the scope of another assembly.

  • It forms a reference scope boundary. The assembly's manifest contains assembly metadata that is used for resolving types and satisfying resource requests. It specifies the types and resources that are exposed outside the assembly. The manifest also enumerates other assemblies on which it depends.

  • It forms a version boundary. The assembly is the smallest versionable unit in the common language runtime; all types and resources in the same assembly are versioned as a unit. The assembly's manifest describes the version dependencies you specify for any dependent assemblies. For more information about versioning, see Assembly Versioning.

  • It forms a deployment unit. When an application starts, only the assemblies that the application initially calls must be present. Other assemblies, such as localization resources or assemblies containing utility classes, can be retrieved on demand. This allows applications to be kept simple and thin when first downloaded. For more information about deploying assemblies, see Deploying Applications.

  • It is the unit at which side-by-side execution is supported. For more information about running multiple versions of an assembly, see Assemblies and Side-by-Side Execution.

Assemblies can be static or dynamic. Static assemblies can include .NET Framework types (interfaces and classes), as well as resources for the assembly (bitmaps, JPEG files, resource files, and so on). Static assemblies are stored on disk in portable executable (PE) files. You can also use the .NET Framework to create dynamic assemblies, which are run directly from memory and are not saved to disk before execution. You can save dynamic assemblies to disk after they have executed.

There are several ways to create assemblies. You can use development tools, such as Visual Studio, that you have used in the past to create .dll or .exe files. You can use tools provided in the Windows Software Development Kit (SDK) to create assemblies with modules created in other development environments. You can also use common language runtime APIs, such as Reflection.Emit, to create dynamic assemblies.

Title

Description

Assembly Contents

Describes the elements that make up an assembly.

Assembly Manifest

Describes the data in the assembly manifest, and how it is stored in assemblies.

Global Assembly Cache

Describes the global assembly cache and how it is used with assemblies.

Strong-Named Assemblies

Describes the characteristics of strong-named assemblies.

Assembly Security Considerations

Discusses how security works with assemblies.

Assembly Versioning

Provides an overview of the .NET Framework versioning policy.

Assembly Placement

Discusses where to locate assemblies.

Assemblies and Side-by-Side Execution

Provides an overview of using multiple versions of the runtime or of an assembly simultaneously.

Programming with Assemblies

Describes how to create, sign, and set attributes on assemblies.

Emitting Dynamic Methods and Assemblies

Describes how to create dynamic assemblies.

How the Runtime Locates Assemblies

Describes how the .NET Framework resolves assembly references at run time.

Assemblies are the building blocks of the .NET Framework; they form the fundamental unit of deployment, version control, reuse, activation scoping, and security permissions. An assembly provides the common language runtime with the information it needs to be aware of type implementations. It is a collection of types and resources that are built to work together and form a logical unit of functionality. To the runtime, a type does not exist outside the context of an assembly.

This section describes how to create modules, create assemblies from modules, create a key pair and sign an assembly with a strong name, and install an assembly into the global assembly cache. In addition, this section describes how to use the MSIL Disassembler (Ildasm.exe) to view assembly manifest information.

System_CAPS_noteNote

Starting with the .NET Framework version 2.0, the runtime will not load an assembly that was compiled with a version of the .NET Framework that has a higher version number than the currently loaded runtime. This applies to the combination of the major and minor components of the version number.

In This Section

Creating Assemblies

Provides an overview of single-file and multifile assemblies.

Assembly Names

Provides an overview of assembly naming.

How to: Determine an Assembly's Fully Qualified Name

Describes how to determine the fully qualified name of an assembly.

Running Intranet Applications in Full Trust

Describes how to specify legacy security policy for full-trust assemblies on an intranet share.

Assembly Location

Provides an overview of where to locate assemblies.

How to: Build a Single-File Assembly

Describes how to create a single-file assembly.

Multifile Assemblies

Describes reasons for creating multifile assemblies.

How to: Build a Multifile Assembly

Describes how to create a multifile assembly.

Setting Assembly Attributes

Describes assembly attributes and how to set them.

Creating and Using Strong-Named Assemblies

Describes how and why you sign an assembly with a strong name, and includes how-to topics.

Delay Signing an Assembly

Describes how to delay-sign an assembly.

Working with Assemblies and the Global Assembly Cache

Describes how and why you add assemblies to the global assembly cache, and includes how-to topics.

How to: View Assembly Contents

Describes how to use the MSIL Disassembler (Ildasm.exe) to view assembly contents.

Type Forwarding in the Common Language Runtime

Describes how to use type forwarding to move a type into a different assembly without breaking existing applications.

Reference

Assembly

The .NET Framework class that represents an assembly.

Related Sections

How to: Obtain Type and Member Information from an Assembly

Describes how to programmatically obtain type and other information from an assembly.

Assemblies in the Common Language Runtime

Provides a conceptual overview of common language runtime assemblies.

Assembly Versioning

Provides an overview of assembly binding and of the AssemblyVersionAttribute and AssemblyInformationalVersionAttribute attributes.

How the Runtime Locates Assemblies

Describes how the runtime determines which assembly to use to fulfill a binding request.

Reflection in the .NET Framework

Describes how to use the Reflection class to obtain information about an assembly.