When .Net application is executed at that time control will go to Operating System, then Operating System Create a process to load CLR
The program used by the operating system for loading CLR is called run time host, which are different depending upon the type of application that is desktop or web based application i.e.The run time host for desktop applications is API function called CorbinToRuntime.
The run time host for web based applications is asp.net worker process (aspnet-wp.exe).
CLR run time engine comes with set of services, which are classified are as follows
- Assembly Resolver
- Assembly Loader
- Type Checker
- COM marshaller
- Debug Manager
- Thread Support
- IL to Native compiler
- Exception Manager
- Garbage Collector
Assembly resolver will read manifest of application, it will identify private and shared assembly required for application execution, the request will be send to assembly loader.
Type checker will verify types used in the application with CTS or CLS standards supported by CLR, this provides type safety.
COM marshaller will provide communication with COM component, this supports COM interoperability.
Debug Manager Service will activate debugger utility to support line by line execution; the developer can make changes as per requirement without terminating application execution.
Thread support will manage more than one execution path in application process. This provides multi threading support.
IL to Native compiler
IL to native compiler is called JIT compiler (just-in-time compiler), this will convert IL code into operating System native code.
Exception Manager will handle exceptions thrown by application by executing catch block provided by exception, it there is no catch block, it will terminate application.
Garbage Collector will release memory of unused objects, this provides automatic memory management.
This is the brief introduction about the CLR, In future i will write the detail article about each services’ hope it’s helpful for all readers.