Tuesday, December 25, 2018

Assemblies in .Net


Assemblies in .Net:

Microsoft .Net Assembly is a logical unit of code, that contains code which the Common Language Runtime (CLR) executes. It is the smallest unit of deployment of a .net application and it can be a .dll or an exe . Assembly is really a collection of types and resource information that are built to work together and form a logical unit of functionality. It include both executable application files that you can run directly from Windows without the need for any other programs (.exe files), and libraries (.dll files) for use by other applications.

Assemblies are the building blocks of .NET Framework applications. During the compile time Metadata is created with Microsoft Intermediate Language (MSIL) and stored in a file called Assembly Manifest . Both Metadata and Microsoft Intermediate Language (MSIL) together wrapped in a Portable Executable (PE) file. Assembly Manifest contains information about itself. This information is called Assembly Manifest, it contains information about the members, types, references and all the other data that the runtime needs for execution.

Every Assembly you create contains one or more program files and a Manifest. There are two type program files: Process Assemblies (EXE) and Library Assemblies (DLL). Each Assembly can have only one entry point.

An assembly performs following functions:
-It contains IL code that gets executed by common language runtime.
-It forms a security boundary.
-An assembly is the unit at which permissions are requested and granted.
-It ensures type safety by establishing name scope for types at the runtime.
-It contains version information.
-It allows side-by-side execution of multiple versions of same assembly.

Types of Assembly:

1.     Private Assembly:
 A private Assembly is used only by a single application, and usually it is stored in that application's install directory.

2.     Shared Assembly:
A shared Assembly is one that can be referenced by more than one application. If multiple applications need to access an Assembly, we should add the Assembly to the Global Assembly Cache (GAC).

3.     Satellite Assembly:
A Satellite Assembly contains only static objects like images and other non-executable files required by the application.



Prof. Shardul P. Patil
profshardulp.patil@gmail.com

No comments:

Post a Comment