Wednesday, 11 January 2012

How does Window execute a .net exe file?

Every .exe or .dll file apart from containing the metadadata table and the IL code also contain a PE32(32+) header thata deteremines what kind of machine or processor this exe is targetting for(32 bit,64 bit etc...)

After the windows has examined what processor is needed for this exe from the header of the exe it will try to load the corrosponding version(X86,X64 or IA64)mscoree.dll to the address space of the process.For a 32 bit system this dll is found in C:\Windows\System32 for a 64 bit system this is found in the same directory for backword compatibility.

The processor primary thread than call a method defined inside mscoree.dll.This method will initialize the CLR,executes the exe assembly and calls the main method.

At this point the managed application is up and running.

No comments:

Post a Comment