4

What happens when I compile .NET source code (c# or vb) to .exe file? I wish to understand the process which happens during making an exe file and have viewed several questions regarding reverse engineering and decompilation (for example, How do I decompile a .NET EXE into readable C# source code? and What happens when user click .NET assembly (EXE)?)

Thanks in advance

Community
  • 1
  • 1
irror
  • 301
  • 1
  • 5
  • 15
  • 1
    [Managed Execution Process - MSDN](http://msdn.microsoft.com/en-us/library/k5532s8a.aspx) – Habib Dec 21 '12 at 06:50
  • Take a look at [How does C# compilation get around needing header files?](http://stackoverflow.com/questions/1917935/how-does-c-sharp-compilation-get-around-needing-header-files/1918663#1918663) – KV Prajapati Dec 21 '12 at 06:50

2 Answers2

6

The managed execution process includes the following steps

  1. Choosing a compiler

    To obtain the benefits provided by the common language runtime, you must use one or more language compilers that target the runtime.

  2. Compiling your code to MSIL

    Compiling translates your source code into Microsoft intermediate language (MSIL) and generates the required metadata.

  3. Compiling MSIL to native code

    At execution time, a just-in-time (JIT) compiler translates the MSIL into native code. During this compilation, code must pass a verification process that examines the MSIL and metadata to find out whether the code can be determined to be type safe.

  4. Running code

    The common language runtime provides the infrastructure that enables execution to take place and services that can be used during execution.

look here for detailled information: http://msdn.microsoft.com/en-us/library/k5532s8a.aspx

MUG4N
  • 19,377
  • 11
  • 56
  • 83
1

you may take a look on the following links that i think they are usefull,
1- Image Describing CLR.
2- Wikipedia Description of .NET Framework
3- .Net Framework Architecture

Sanfoor
  • 311
  • 2
  • 5