Common Language Runtime (CLR) in C#
The Common Language Runtime (CLR) is a component of .NET-Framework that is responsible for managing the execution of all .NET-aware languages. It is physical represented by a library named mscoree.dll (Microsoft Common Runtime Execution Engine).
Functions of Common Language Runtime (CLR) in C#
- Loads the CIL code (Generated by Compiler) into the memory.
- Interacts with the types (CTS data types discussed earlier) available in base class library (mscorlib.dll) based on the need.
- Produces the platform-specific instructions (Native Code) from loaded CIL.
- Performs memory management (like Garbage Collection), type safety and exception handling.
- CLR does not execute the code which are not CLS-compliant. This type of code is called Unmanaged Code.