Managed Execution

Managed execution is the name given for the process of creating applications under the .NET Framework. The steps involved are as follows:

  1. Write code using one or more .NET compilers. Note that for software components to be useable by components that are written in other languages, these components must be written using only language features that are part of the Common Language Specification (CLS).

  2. Compile the code. The compiler translates source code to Microsoft Intermediate Language (MSIL) and generates the necessary metadata for the application.

  3. Run the code. When code is executed, the MSIL is compiled into native code (which is CPU-specific code that runs on the same computer architecture as the compiler) by a Just In Time (JIT) compiler. If required, the JIT checks the code for type safety. If the type-safety check fails, an exception is thrown.

Code that cannot access invalid memory addresses or perform other illegal operations that may result in an application crash is called type-safe code . Code that is verified to be type-safe by the JIT is called verifiably type-safe code. Due to limitations in the verification process, code can be type-safe and yet not be verifiably type-safe.

Get VB .NET Language in a Nutshell 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.