C# Tutorials - Herong's Tutorial Examples - v3.32, by 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.
Table of Contents
Logical Expressions and Conditional Statements
Visual C# 2010 Express Edition
►C# Compiler and Intermediate Language
►Compiling and Running C# Programs
Compilation - Converting Source Code to Bytecode
.NET Intermediate Language Disassembler
CLR Based PE (Portable Executable) Files
Disassembling Intermediate Language Bytecode
Assembling Intermediate Language Source Code
Compiling C# Source Code Files
MSBuild - Microsoft Build Engine
System.Diagnostics.FileVersionInfo Class
WPF - Windows Presentation Foundation