O'Reilly logo

.NET Programming: A Practical Guide Using C# by Pradeep Tapadiya

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Managed Code Execution

To load and execute an assembly, the common language runtime has to be hosted within a process first. The .NET Framework provides APIs to let an application host the common language runtime. Some examples of such host applications are ASP.NET, SQL Server .NET, and so on.

An EXE-based assembly contains a small piece of bootstrapping code that points to a function exported by the .NET runtime, named CorExeMain. When such an assembly is executed, the OS creates a process and executes CorExeMain. This function in turn loads the common language runtime into the process and transfers control to it.

Using a standard PE file mechanism to bootstrap the common language runtime is a clever technique on the part of Microsoft. It ensures ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required