C# Tutorials - Herong's Tutorial Examples - Version 3.30, by Dr. Herong Yang
Compiling and Running C# Programs
This section describes the process of compiling and executing a C# program. Compilation means converting C# source into Intermediate Language bytecode. Execution means converting bytecode to native code and running it.
In previous chapters, we learned some basics of the C# language. Now let's have closer look at the process of C# program compilation and execution.
At a high level, the process of compiling and running a C# program can be illustrated
in this diagram (source: wikipedia.com):
As you can see from the diagram, compilation and execution of a C# program can described as:
1. Compilation - Converting source code in C# language into bytecode in IL (Intermediate Language) using C# compiler.
This step is usually done by the Microsoft C# compiler like the "csc" command line tool, which will actually write the bytecode in a PE (Portable Executable) file.
2. Execution - Converting bytecode in Intermediate Language into native code in machine language on-the-fly (or just-in-time) and executing the native code in a single step.
This step is usually done by the Microsoft CLR (Common Language Runtime), which will be invoked when a PE file with IL bytecode is loaded into the Windows system.
Last update: 2010.
Table of Contents