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!

Locating Types

Development tools emit references to types as typerefs in the metadata for the module containing the call. Type reference information includes the name of the type, which can include the namespace, and the resolution scope which indicates the module or assembly from which the type can be resolved.

A type can be found in one of three locations relative to the caller:

The contents of these typeref fields varies depending on whether the target of the reference is contained in the same module, the same assembly, or a different assembly than the caller.

Reference within the Same Module

When a reference is made to a type in the same module as the caller, the NGWS runtime optimizes away the type reference and replaces it with the type definition of the referenced type. As a result, the method reference points directly to the definition of the type containing the method. All information needed to activate the type is contained in its type definition.   

References inside a module cannot have version binding policy applied to them since versioning is done at the assembly level. They always run with the implementation of the class they were compiled with.

Reference between Modules within the Same Assembly

The runtime loader uses ModuleRefs to resolve type references between modules in the same assembly. This ModuleRef describes the module the requested type is in. When resolving the type reference, the loader uses this ModuleRef directly without going through the manifest.

References between types in the same assembly cannot have version binding policy applied to them. They always run with the implementation of the class pointed to by the typeref or manifest.

References between Assemblies

References to types in a different assembly are be emitted with AssemblyRef information. This AssemblyRef identifies the assembly the requested type is in. When resolving the type reference, the loader will use this AssemblyRef directly without going through the manifest.