2.1. Common Language RuntimeThe Common Language Runtime (CLR) is an environment that manages code execution and provides application-development services. It provides all of the common features required by all .NET-enabled languages. Visual Basic and other .NET languages are simply wrappers that expose the CLR's functionality. Because the CLR provides all of the core functionality for all .NET languages, components written in different .NET languages can interact with each other immediately, with no language-specific conflicts. Even data types are shared among .NET languages through the CLR's Common Type System (CTS). While data types may have different names in Visual Basic than they do in C#, they will all be based on underlying CLR data types. The Common Language Specification (CLS) defines the minimal set of .NET features that must be implemented by a .NET-compliant compiler. Components developed to be CLS-compliant may be limited in their ability to interact with applications and components that use a wider range of .NET features. The output of a .NET compiler includes metadata, which is information that describes the objects that are part of the generated application or library. The metadata describes the following:
Metadata is used by the CLR to support functionality such as:
By including metadata in a compiled software component, that component becomes "self-describing." This tells the CLR everything it needs to prepare and execute a .NET application, and to allow it to interact with other .NET components. |