User Guide
542
About Microsoft .NET Technology
Search for “Interoperating with Unmanaged Code” in the MSDN Library
(msdn.microsoft.com/library/).
What is an assembly?
An assembly is the primary building block of a .NET application. An assembly contains its
own naming, binding, versioning, deployment, and configuration information. It consists
of 2 elements: a manifest, which is the metadata that describes information about the
assembly and any resources it depends on; and a set of instructions in the form of
Microsoft Intermediate Language (MSIL) code that is executed when the assembly is
referenced.
You can group assembly elements into a single file assembly, which incorporates the
manifest into a portable executable (PE) file, which can be an .EXE or .DLL, with the
source code. You also can create a multifile assembly consisting of modules of compiled
code, resources, or other files required by the application. In a multifile assembly, the
manifest can be a standalone file or it can be incorporated into one of the PE files in the
assembly.
When you add a .NET assembly to an installation, Wise for Windows Installer creates
entries in the MsiAssembly and MsiAssemblyName tables.
See Assemblies in the Windows Installer SDK Help.
How does .NET reduce file sharing conflicts?
An important benefit of .NET installations is the reduction of file sharing conflicts. With
the common language runtime, the assembly is described by a manifest; the registry is
no longer relied upon for storing and accessing the COM activation data. This allows
components to be fully isolated from each other.
Assembly sharing is accomplished in several ways:
! Global Assembly Cache
To install .NET assemblies that are intended to be shared by many applications on
the computer, make sure they are strongly named and install them into the Global
Assembly Cache, which is a machine-wide code cache. Do not install assemblies into
the Global Assembly Cache unless they specifically need to be shared. The Global
Assembly Cache is available only if the .NET Framework is installed on the
destination computer.
! Side-by-side
To safely share COM or Win32 assemblies among multiple applications and to
minimize .DLL conflicts, use side-by-side assembly sharing. Instead of having a
single version of an assembly that assumes backward compatibility with all
applications, side-by-side assembly sharing enables multiple versions of a COM or
Win32 assembly to run simultaneously on the destination computer. Side-by-side
assembly sharing is available only on Windows XP or later. See Side-by-Side
Assemblies in the Windows Installer SDK Help.
! Private assembly
To reserve a Win32 assembly for the exclusive use of one application, install it in a
directory that is private to the application, typically the application directory. This is
called a private assembly. The dependency of the application on the private assembly
is specified in an application manifest file. On operating systems earlier than
Windows XP, a copy of the private assembly and a .local file is installed into a private
directory for the exclusive use of the application. A version of the assembly is also
globally registered on the system and made available for any application that binds
to it. The global version of the assembly can be the version installed with the
application or an earlier version.