Kalamro
Kalamro

Reputation: 263

How .NET build / compilation works

I was trying to find some simple overview but found nothing. So I hope someone will help me here. I would like to know what is the flow of compilation/assembly process in .NET. I just know:

1)The code is compiled into CIL
2)
3)
...
4) Executable binaries

Upvotes: 1

Views: 320

Answers (1)

Henk Holterman
Henk Holterman

Reputation: 273169

  1. Your C#/VB.NET/... code is compiled to MSIL (CIL)
  2. The MSIL is stored in an assembly (.DLL / .EXE)
  3. .NET Assemblies are executed by the CLR (.NET runtime)
  4. When an assembly is 'loaded' that means its code is loaded-on-demand
  5. When the CLR loads a MSIL method it is compiled to native code
  6. The native code is executed but not stored on disk

There exists a tool NGEN.exe to pre-compile the MSIL but it is only used in special cases.

Upvotes: 4

Related Questions