Consider we have .NET Winforms application or Console Application. Can anyone tell me what will happen step-by-step until the WinForm or Console Application is launched. I would like know the internals - like how EXE will communicate with Framework, what is the role of CLR, what happens in case of exception while launching applicaiton itself.etc...
A:
You probably wants something like: Microsoft .NET Internals
Or since that's not released yet: Essential .NET, Volume I: The Common Language Runtime
http://www.amazon.co.uk/Essential-NET-Microsoft-Development-Paperback/dp/0201734117
ho1
2010-05-07 11:58:51
Thank you ho. I ll check through the books
Sathish
2010-05-07 12:11:40
+7
A:
When you double click on a .net .exe assembly:
- Windows' PE loader kicks in
- If you're on a Windows >= Windows XP it will detect that the executable is a managed executable and will forward it to .net by calling _CoreExeMain in mscoree.dll (_CoreDllMain if you double clicked on a managed .dll). It can use the assembly configuration file to know which runtime to use.
- If you're on Windows < Windows XP, the .exe file contains a small native piece of code that will jump to mscoree.dll's _CoreExeMain or _CoreDllMain.
- Then mscoree.dll initializes the .net runtime, depending on the global configuration, the assembly configuration file, and what not.
- Then if it's a .exe, it will JIT compile its entry point method, and start executing it.
Jb Evain
2010-05-07 12:04:45