Packaging .NET Components: Assemblies

The basic code packaging unit in .NET is the assembly. An assembly is a logical DLL—i.e., assembly can combine more than one physical DLL into a single deployment, versioning, and security unit. However, an assembly usually contains just one DLL (the default in Visual Studio.NET) and you have to use command-line compiler switches to incorporate more than one DLL in your assembly. An assembly is not limited to containing only DLLs. An assembly can also contain an EXE. As a component developer, you usually develop components that reside in a single or multiple DLL assembly to be consumed by a client application residing in an assembly that has an EXE. The code in the assembly (in the DLLs or the EXE) is only the IL code, and at runtime the IL is compiled to native code, as explained previously.

An assembly contains more than just the IL code. Embedded in every assembly is metadata, a description of all the types declared in the assembly and a manifest, a description of the assembly and all other required assemblies. The manifest contains various assembly-wide information, such as the assembly version information. The version information is the product of a version number provided by the developer and a build and revision number captured by the compiler (or provided by the developer as well) during the build. All DLLs in the assembly share the same version number and are deployed as one unit.

The assembly boundary serves as the .NET security ...

Get COM & .NET Component Services 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.