NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Loading Managed Code

The VES provides a class loader whose job is to load the implementation of a loadable type into memory and prepare it for execution. Implementations of types are supplied in assemblies, and the types are always referenced through their assembly. The class loader uses the name of the assembly, version information captured when the type reference was compiled, information about the application that is attempting to load the type, and administrative configuration to locate the assembly and its constituent PE files. A single PE File (see the File Format Specification) may contain the implementation of many types, but the implementation of a single type cannot span multiple PE files.

The class loader ensures the following:

The class loader is also part of the NGWS runtime security enforcement mechanism. It performs a variety of consistency checks including enforcement of certain accessibility rules (e.g., a child cannot override a final virtual method) and self-consistency requirements (a value class cannot contain an instance of itself as a field). This amounts to a minimal, mandatory, verification process that precedes the more complex (and optional) IL code verification process (see Verification of Implementation Code).

Implementations of classes and interfaces can include initialization code that must be run once before any active reference (such as creating an instance, calling a method, or referencing a field of the class) is made to the class. Implementations can be marked to allow the initialization to occur when the implementation is loaded or be deferred until the first active reference.