Components behind Execution .NET

An integrated component of windows operating system which comprises of set of class libraries and Common Language Runtime (CLR). It is required to execute application written using Common Language Specification (CLS) complied programming language.


Source code is sent to .net assembly to compile. So .net assembly contains many information regarding the program or sources being used by this program commonly references.

.Net assembly after compiling and executing its task, at the end it form two files.

  • Self Execute (.exe)
  • Supporting Component (.dll)

Not both only one .exe or .dll. If the compiling program is class Library then after compiling it will form .dll which can be further used in any program as a reference. It is very useful in a way that you add all the classes in it which have to be used in any program or application. If it is not an class library than it will form .exe file.

Now Explaining parts of .Net Assembly.

Manifest Information

It contains all the information regarding the assembly like: 
  • Name of Assembly
  • Version
  • Digital Signature

In addition to this if this assembly is using any other assembly then its information is placed here.

Resources

 It contains all other things being used by the application like.
  • Images.
  • Strings
  • Icons 
 

The .exe or .dll file being created by the .net framework is executed by the Common Language Runtime (CLR). CLR contains Automatic Garbage Collector i.e IDisposable<> Class which I will explain later during the execution of code. So in C# when you are execute the program, garbage collector is running with it. So you don’t need to worry about declaring so much variables. Those variable which are not being used by the program are automatically dispose.

So, CLR execute .exe or .dll file by calling another compiler which is called JIT compiler or ‘Just In Time Compiler’. When you compile a program .net assembly only make .exe file of it or .dll file. But when you execute that file JIT compiler is called or run.

CIL changes code into Machine Code and which runs and give output. But what is happening at the back side is now explained briefly.