none
.NET Compilation and Execution RRS feed

  • Question

  • Hi, I am confused about the compilation, building and execution process that takes place with .NET framework. I know the specific functions of CLR, CTS, garbage collection, but not sure of the step-by-step process that actually happens from code development to installation or deployment of application. Can someone explain please?

       if I write a vb.net program, what happens when I build it? Does it get compiled into IL? Does this happen only once? When does memory allocation take place? If I install its .exe file on a workstation, how does compiling, memory allocation and execution take place?

    I am sorry if this seems very base-level, but I am really confused. I just get definitions and functions of .NET components when I search the Web.

    Thursday, February 21, 2013 7:27 AM

Answers

  • The sequence goes this way

    1. When  you build, the Code (your vb.net) gets compiled into Intermediate Language (IL) and persisted as an assembly (exe or dll). This happens only once, unless you changes you code itself.

    2. When the user requests the assembly (IL)  to be executed, IL gets JIT( Just In Time ) compiled into  the native ( machine language ) code.

    3. This machine code then runs on your machine.

    You can get more information http://rthumati.wordpress.com/2010/05/20/overview-of-compilation-and-execution-in-net/ 

    Answers to some of your questions

    1. Memory (RAM) gets allocated only when the native code runs on your machine.

    2. Exe only gets JIT compiled, beyond which the native executes.

    Thursday, February 21, 2013 9:59 AM

All replies

  • The sequence goes this way

    1. When  you build, the Code (your vb.net) gets compiled into Intermediate Language (IL) and persisted as an assembly (exe or dll). This happens only once, unless you changes you code itself.

    2. When the user requests the assembly (IL)  to be executed, IL gets JIT( Just In Time ) compiled into  the native ( machine language ) code.

    3. This machine code then runs on your machine.

    You can get more information http://rthumati.wordpress.com/2010/05/20/overview-of-compilation-and-execution-in-net/ 

    Answers to some of your questions

    1. Memory (RAM) gets allocated only when the native code runs on your machine.

    2. Exe only gets JIT compiled, beyond which the native executes.

    Thursday, February 21, 2013 9:59 AM
  • Thanks Sezhiyan,

     That makes a lot of sense now.. So does the whole process begin again if I close the application and then reopen it and say, click a button?

    Manasi

    Thursday, February 21, 2013 10:55 AM
  • Every time you run a .Net application, the assembly gets JITed and then executed. Post one executed the JIT process is cached, so if you done make any changes to the source, even the JITing doesnt happen.
    Thursday, February 21, 2013 11:08 AM