Assemblies and the Microsoft Intermediate Language ( MSIL )

In .NET, an application compiled into MSIL bytecode is stored in an assembly. The assembly is contained in one or more PE (portable executable) files and may end with an EXE or DLL extension.

Some of the information contained in an assembly includes:
Manifest — Information about the assembly, such as identification, name, version, and so on.
Versioning — The version number of an assembly.
Metadata — Information that describes the types and methods of the assembly .

To get a better idea of a MSIL file and its content, take a look at the following example, which has two console applications — one written in C# and the other written in VB.NET.
The following C# code displays the “ Hello, World ” string in the console window:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace HelloWorldCS
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine(“Hello, World!”);
Console.ReadLine();
}
}
}

Likewise, the following VB.NET code displays the “ Hello, World ” string in the console window:

Module Module1
Sub Main()
Console.WriteLine(“Hello, World!”)
Console.ReadLine()
End Sub
End Module

When both programs are compiled, the assembly for each program has an .exe extension. To view the content of each assembly, you can use the ildasm (MSIL Disassembler) tool.
Launch the ildasm tool from the Visual Studio 2008 Command Prompt window (Start Programs Microsoft Visual Studio 2008 Visual Studio Tools Visual Studio 2008 Command Prompt).

The following command uses the ildasm tool to view the assemblies for the C# and VB.NET programs:

C:\MSIL > ildasm HelloWorldCS.exe
C:\MSIL > ildasm HelloWorldVB.exe