I am just trying to get a better grasp on what happens in a simple scenario when the following code is added to a file and saved with the .cs extension:
public class HelloWorld
{
public static void Main()
{
System.Console.WriteLine("Hello World!");
System.Console.ReadLine();
}
}
and then this program is run at the windows command line with:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>csc /t:exe /out:C:\HelloWorld\HelloWorld.exe C:\HelloWorld\HelloWorld.cs
I can see this process produces an .exe file, however when reading about the compile process on wikipedia it states:
- Source code is converted to Common Intermediate Language (CIL), which is the CLI's equivalent to Assembly language for a CPU.
- CIL is then assembled into a form of so-called bytecode and a CLI assembly is created.
- Upon execution of a CLI assembly, its code is passed through the runtime's JIT compiler to generate native code...
- The native code is executed by the computer's processor.
So does the .exe file itself consist solely of Common Intermediate Lanaguage? And is this file itself what the wikipedia article refers to as the 'CLI assembly'? I'm a bit confused because I can only see the .exe file and to me the term 'assembly' infers more than one file.
And related question:
- is the JIT compiler somewhere in the Microsoft.NET directory and upon executing the .exe file the file communicates with the JIT compiler which then outputs the instructions in native code?