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
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.