C'è una decente panoramica del Runtime Common Language di .NET su MSDN . Ci sono alcuni paragrafi chiave che potrebbero farti iniziare a capire il processo:
The common language runtime provides the infrastructure that enables
managed execution to take place and services that can be used during
execution. Before a method can be run, it must be compiled to
processor-specific code. Each method for which MSIL has been generated
is JIT-compiled when it is called for the first time, and then run.
The next time the method is run, the existing JIT-compiled native code
is run. The process of JIT-compiling and then running the code is
repeated until execution is complete.
During execution, managed code receives services such as garbage
collection, security, interoperability with unmanaged code,
cross-language debugging support, and enhanced deployment and
versioning support.
In Microsoft Windows XP and Windows Vista, the operating system loader
checks for managed modules by examining a bit in the COFF header. The
bit being set denotes a managed module. If the loader detects managed
modules, it loads mscoree.dll, and _CorValidateImage and
_CorImageUnloading notify the loader when the managed module images are loaded and unloaded. _CorValidateImage performs the following
actions:
Ensures that the code is valid managed code.
Changes the entry point in the image to an entry point in the runtime.