What does an executable compiled using C# have?

As far as my understanding is,

  1. Any code that is written using C# or F# or VB.Net, is compiled by their respective compilers in Visual studio to IL code.

  2. So, the .NET framework runtime (CLR) installed in client's machine will use this IL code to convert to machine code and run the program.

The question is, what does this EXE contain ? IL and some headers ?

Upvotes: 1

Views: 401

Answers (1)

Saeb Amini
Saeb Amini

Reputation: 24380

In the .NET world, those basic units of deployment are called Assemblies, with an .exe extension in the case of an application, or a .dll extension in the case of a library.

In short, an assembly contains four types of things:

  1. An assembly manifest which provides information to the .NET runtime, such as the assembly’s name, version, requested permissions, and other assemblies that it references.
  2. An application manifest which provides information to the operating system, such as how the assembly should be deployed and whether administrative elevation is required.
  3. Compiled types: the compiled IL code and metadata of the types defined within the assembly.
  4. and Resources: other data embedded within the assembly, such as images and localizable text.

Of the above four, only the assembly manifest is mandatory.

Upvotes: 3

Related Questions