Assembly is a basic element ofpackaging in .NET. An assembly consists of IL code, metadata that describeswhat is in the assembly, and any other files or information that theapplication needs to run, such as graphics and sound files.

An assemblyperforms the following functions:

1-It contains code that the CLR executes. Assembly contains IL code plus the manifest in a portable executable (PE) file will be executed by CLR. Note that each assembly can have only one entry point (i.e., DllMain, WinMain, or Main).

2- An assembly is a unit at which permissions are requested and granted. Hence it forms a security boundary.

3- It forms a type boundary. Every assembly has an aunique name and the type’s within those assemblies includes the name of that assembly. Hence every type has a unique name or unique boundary. The assembly manifest contains assembly metadata that is used by CLR for resolving types and satisfying resource requests.

4- It forms a version boundary. The assembly is  the smallest versionable unit in the CLR. All types and resources in the same assembly are versioned as a unit. The assembly’s manifest describes the version.

5- 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 whenever they are called. This allows applications to be kept simple and thin at first. 

Assemblies can be static or dynamic. Static assemblies can include.NETtypes (interfaces and classes), as well as required resources for the assembly(bitmaps, JPEG files, resource files, and so on). Static assemblies are a stored on disk in PE files. Dynamic assemblies are one which run directly from memory and are not saved to disk before execution. They can be saved disk after they have executed.

  Modified On Sep-18-2014 01:23:54 PM

Leave Comment