Question

I read topic from google and I understand this:

  1. Windows loader loads the exe or dll of .net app.
  2. Then windows loader creates clr for that process.
  3. Then it locates entry point to application and call it.
  4. But before that class loader service of clr comes and loads the class containing Main method.
  5. And then jit compilation takes place.
  6. The clr provoids services like gc,exception handling,class loading etc to our app.

My questions are:

Now when we run .net app clr locates entry point and starts execution . But when it encounters

Class1 ob = new Class1();  

that time how our process calls the service of CLR called as class loader? MSIL code equivalent to is newobj internally calls to clr's class loader service?

Was it helpful?

Solution

It takes a lot of effort in understanding the internal working of CLR. But if you are interested go through this CLR Internal Workings

The site gives an extensive and detailed explanation of CLR working.

Specifically your answer comes under the ObjectInstance section in the site.They have used

SmallClass obj = new SmallClass();

to explain the functionality.

Hope it helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top