Assemblies in
Assemblies in
NET
16 October 2024 10:38
Although they both have the same file extension, .NET assemblies include
metadata that describes all the types that are defined in the assembly, with
information about its members — methods, properties, events, and fields
The metadata of .NET assemblies also provides information about the files that
belong to the assembly, version information, and the exact information about
assemblies that are used.
.NET assemblies are the answer to the DLL hell we’ve seen previously with native
DLLs.
–occurs when a new application loads a new version of a DLL file, overwriting
previous version
–Such action breaks earlier applications that relied on original DLL
•Assemblies are self - describing installation units, consists of one or more files.
•One assembly could be a single DLL or EXE or it can be made of different files
•Features of Assemblies
1.self – describing
–Include metadata that describes the assembly
2.Version dependencies
–Storing the version of any referenced assemblies in the manifest makes it
possible to easily find deployment faults
3.loaded side by side
–Different versions of the same assembly to be used inside a single process
(Windows 2000)
4.Application domain
–A number of applications can run independently inside a single process.
–Faults in one application cannot directly affect other applications inside the same
process
5.ClickOnce deployment
–Installation can be as easy as copying the files that belong to an assembly. This
feature named ClickOnce deployment. [zero impact (xcopy) installation]
•Assembly Structure:
–Assembly consists of assembly metadata describing the complete assembly, type
metadata describing the exported types and methods, MSIL code, and resources
–All these parts be inside of one file or spread across several files
•Assembly Manifests:
–part of Metadata, important part of assembly
–describes the assembly with all the information that ’s needed to reference it and
lists all its dependencies
–The parts of the manifest are
1.Identity — Name, version, culture, and public key
2.A list of files — Files belonging to this assembly,
A single assembly must have at least one file but may contain a number of files.
3.A list of referenced assemblies — All assemblies used from the assembly are
documented inside the manifest (version no, public key - uniquely identify
assemblies)
4.A set of permission requests - permissions needed to run this assembly
5.Exported types - included if they are defined within a module and the module is
referenced from the assembly; otherwise, they are not part of the manifest