About Runtime Components of .NET FrameworkIn .NET, Common Language Runtime or CLR is an important part along with the class libraries of the framework. It provides the special software environment to the .NET programs at the time of their execution and fulfills their runtime requirements. Here we will discuss the components of CLR which are modules and assemblies. CLR module
contains the programs designed for the CLR itself or we can say the code
of the CLR. It is a stream of bytes having code written either in processor
specific machine language or common intermediate language (CIL). In addition
to code, CLR modules consist of metadata and resources too.
There is a close connection between modules and assemblies. Actually assemblies are logical constructs containing one or more modules, resources and other files. These are used for the purpose of deployment and provide security in .NET application. For the execution of a file having MSIL code in .NET, it should have an associated assembly manifestation. Also assemblies play pivotal role in requesting and granting security permissions. There are two types of assemblies: Static and dynamic. Static assemblies are those which can be stored in the hard disk and contains interfaces, classes and other .NET types. There are four components of static assemblies out of which assembly manifest is the required element and contains assembly metadata. Other three components are type metadata, MSIL and resources. These components are not necessarily required but are useful in constituting a fully functional assembly. There are different mechanisms by which you can group these elements to form an assembly. For example all the four elements can be kept in a single file to form the assembly or a multifile assembly can be created too where different parts of an assembly reside on different files. Assembly manifest consists of data which describes the relationship between the elements of assembly, about versioning of assembly and security measures. As it contains the assembly metadata, it is required part of assembly. Different content of assembly manifest are Assembly name, version number, type reference information etc. Now lets discuss the very important CLR loader which initializes and loads the above discussed modules, assemblies and resources. Its working is based on Just In Time (JIT) compiler and loading of modules and assemblies is done on the demand. This implies that those things in the application which are not in use are not brought into the memory too. So CLR and its components provide a fundamental platform and services for developing and executing applications. It supports component based programming and standards like SOAP and XML. Most importantly it provides metadata to the .NET runtime in order to make it functional and efficient enough to provide services for the execution of .NET programs.
|