Starting a CLR Program

An executable CLR program contains at least three components:

  • The user-defined assembly with an entry point

  • The execution system, found in either mscorsvr.dll or mscorwks.dll

  • The basic type system, found in mscorlib.dll

Whenever a CLR program starts, the runtime environment must start, too. One of the first instructions within any CLR executable achieves this task by calling either _CorExeMain or _CorDllMain, both of which are found in mscoree.dll. As its name suggests, mscoree.dll is the initial part of the execution engine. If an executable serves as a program's entry point, then _CorExeMain is called; if it does not, then _CorDllMain is called. Naturally, mscoree.dll is an unmanaged executable, as it needs to interact ...

Get Programming in the .NET Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.