Common Language Runtime (CLR):
- CLR Stand for Common Language Runtime.
- It is called a heart of .NET framework.
- It provides runtime environment for .NET languages.
CLR has following responsibilities:
- Intermediate language (IL) to native translation: CLR uses Just In Time (JIT) compiler which compiles IL code to machine code. This machine code then executed under .NET framework.
- Code Verification: It provides type safety while code executes. It prevents the source code from performing illegal operations. e.g If source code is accessing invalid memory, CLR prevents it.
- Code Access Security (CAS):
Responsibility of this is to grant rights to programs depending upon the security configurations of the system. - Garbage Collection (GC): Basic responsibility of this is memory management. Thus we can code a program without need to think about how to release a memory allocated by an object. GC automatically releases memory of an object which are not referred any more by a program.