A summary of the interrelationship between ASP.net and the CLR

Source: Internet
Author: User

CLR (COM server)

The CLR is implemented as a COM server in the MSCorWks.dll file. When the. NET framework is installed, the COM server that represents the CLR is registered in the Windows registry.

MSCorEE.dll (GASKET)

MSCorEE.dll's job is to determine what version of the CLR was created. The unmanaged application host invokes the CorBindToRuntimeEx function in MSCorEE.dll (shim) or another similar function to create an instance of CLR Com.

A machine can install multiple versions of the CLR, but only one version of the MSCorEE.dll file in the machine.

The relationship between the above two is shown in the following code (c + +): MSCorEE.dll (GASKET)---->CLR (COM server)

Code highlighting produced by Actipro 

Codehighlighter (freeware) http://www. codehighlighter.com/--> #include <Windows.h>
#include <MSCorEE.h>
#include <stdio.h>
#pragma comment (lib, "Mscoree.lib")
int main (int argc, char* argv[])
{
    iclrruntimehost *pclrhost;
    The CorBindToRuntimeEx () in call <MSCorEE.h> generates the COM server
    HRESULT hr= CorBindToRuntimeEx (null, NULL, NULL, CLSID_ Clrruntimehost, Iid_iclrruntimehost, 

(lpvoid*) &pclrhost); 
    Start CLR
    pclrhost->start ();   
     //............................ Other operations   
     //termination of CLR
     pclrhost->stop ();
     GetChar ();
     return 0;
}

application domain (AppDomain)

An application domain is a container for a set of assemblies. The entire purpose of an application domain is to provide isolation.

The image above is a separate Windows process running a CLR COM server. Each application domain in the CLR has its own loader heap. (System domain, shared domain, Default domain #, other domain)

Some special assemblies such as MSCorLib.dll, which need to be shared by all application domains, are loaded in a way that is neutral to the application domain, and the CLR maintains a special loader heap.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.