The CLR is the foundation on which the Microsoft .NET has
been built. The CLR will be loaded into the memory by the host. A host can be
an ISAPI filter, internet explorer or a Database engine. This is based on the
type of the application. Hosts call the CorBindToRuntimeEx API to load the CLR
into a process. There are four values a host can set when calling
CorBindToRuntimeEx. These settings control which CLR gets loaded and how basic
functions like garbage collection and class loading will behave in the process.
The four settings are: version, server versus workstation, concurrent GC, and
loader optimization. This will be he unmanaged portion of the host.
In order to begin running managed code, a host must obtain a
pointer to an application domain. In many cases, this is the default domain
within the process, but the host can also create additional domains as well.
The GetConfiguration method on ICorRuntimeHost provides access to an interface
called ICorConfiguration that can be used to configure specific aspects of the
CLR that will be loaded into the process, or to register for additional events.