Quote:
So how the MSIL is getting executed ?
There is a wealth of resources on t'internet which explain this:
Code Execution Process[
^] provides a nice overview, but Google can find you more details.
Quote:
Can you also explain me how the Assembly code executes ? For example lets assume we have a program of 100 lines assembly code and when this assembly code start assembling from Assembly to a Native code is it doing it line by line or doing all at once ?
It's never that simple.
MSIL (now called CIL, Common Intermediate Language) is effectively the assembler code, a true native assembly language program is never produced for .NET projects. If you mean real assembler code as in "native processor assembler" then it is (sort of) processed line by line to produce a complete executable file (but the line by line bit is untrue, because there are forward and backward references to consider, and assemblers are normally multipass processing as a result).
MSIL is converted to native code (i.e. binary code that can execute directly on the actual processor) by the JIT compiler on a method-by-method basis, not line by line (except it can also be completely precompiled by Ahead-of-time compilation using NGEN, but that is less common).
And the JIT is only done once: the compiled results are stored and reused.