What is Common Language Runtime?

The Common Language Runtime is the engine that compiles the source code in to an intermediate language. This intermediate language is called the Microsoft Intermediate Language.

During the execution of the program this MSIL is converted to the native code or the machine code. This conversion is possible through the Just-In-Time compiler. During compilation the end result is a Portable Executable file (PE).

This portable executable file contains the MSIL and additional information called the metadata. This metadata describes the assembly that is created. Class names, methods, signature and other dependency information are available in the metadata. Since the CLR compiles the source code to an intermediate language, it is possible to write the code in any language of your choice. This is a major advantage of using the .Net framework.

The other advantage is that the programmers need not worry about managing the memory themselves in the code. Instead the CLR will take care of that through a process called Garbage collection. This frees the programmer to concentrate on the logic of the application instead of worrying about memory handling.