A fundamental unit of any .NET application.
Contains the code that is executed by CLR.
Contains name, version, types (classes and others) created in it and details about other assemblies it references.
May be either an executable file - .EXE or a dynamic link library - .DLL
2. Assembly
A fundamental unit of any .NET application.
Contains the code that is executed by CLR (common language
runtime).
Contains name, version, types (classes and others) created in it
and details about other assemblies it references.
May be either an executable file - .EXE or a dynamic link
library - .DLL
4. Structure of Assembly
Assembly manifest contains:
Assembly name
Version number of the assembly
Culture - language assembly supports
Strong name - required only for global assemblies
List of files in the assembly. An assembly can be made up of
multiple files
Type reference information - informs which type is in which file
of the assembly
Information about referenced assemblies - Contains list of other
assemblies referenced by this assembly. For each assembly
referenced we have assembly name, version, culture and public
key (if assembly is a global assembly)
5. Structure of Assembly
Type metadata
This section of an assembly contains information about all
classes, structure etc. created in the assembly.
MSIL Code
MSIL code of the assembly is placed in third part of the
assembly. This MSIL is converted to native code by CLR at
runtime.
Resource
This section contains messages and pictures used by assembly.
6. Private Assembly
A private assembly is an assembly that is deployed with an
application and is available for the exclusive use of that
application.
Other applications do not share the private assembly.
Private assemblies are one of the methods that can be used to
create isolated applications.
It is stored in the directory where the application resides.
There is no version constraint in a private assembly. To use
private assembly in any application, one needs to deploy them
in the application's directory.
7. Global Assembly
A global assembly is a public assembly that is shared by
multiple applications.
Unlike private assembly,global assembly is not stored at
location where application resides. Global assembly instead is
placed in GAC (Global Assembly Cache) and it can be
referenced anywhere within the system.
So only one copy is stored, but many applications can use that
single copy.
8. Assembly Placement
For most .NET Framework applications, assemblies that
make up an application are located in the application's
directory, in a subdirectory of the application's directory, or
in the global assembly cache.
If the assembly needs is used by multiple applications then
one should make it global else keep it private.