ModuleHandle.ResolveFieldHandle ModuleHandle.ResolveFieldHandle ModuleHandle.ResolveFieldHandle ModuleHandle.ResolveFieldHandle Method

Definition

Returns a runtime field handle for a field identified by a metadata token.

Overloads

ResolveFieldHandle(Int32) ResolveFieldHandle(Int32) ResolveFieldHandle(Int32) ResolveFieldHandle(Int32)

Returns a runtime handle for the field identified by the specified metadata token.

ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])

Returns a runtime field handle for the field identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope.

ResolveFieldHandle(Int32) ResolveFieldHandle(Int32) ResolveFieldHandle(Int32) ResolveFieldHandle(Int32)

Returns a runtime handle for the field identified by the specified metadata token.

public:
 RuntimeFieldHandle ResolveFieldHandle(int fieldToken);
public RuntimeFieldHandle ResolveFieldHandle (int fieldToken);
member this.ResolveFieldHandle : int -> RuntimeFieldHandle
Public Function ResolveFieldHandle (fieldToken As Integer) As RuntimeFieldHandle

Parameters

fieldToken
Int32 Int32 Int32 Int32

A metadata token that identifies a field in the module.

Returns

Exceptions

metadataToken is not a valid token in the scope of the current module.

-or-

metadataToken is not a token for a field in the scope of the current module.

-or-

metadataToken identifies a field whose parent TypeSpec has a signature containing element type var or mvar.

Remarks

To resolve a metadata token that identifies a field whose parent TypeSpec has a signature containing element type var or mvar, use the ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) method overload, which allows you to supply the necessary context.

Note

Information about metadata tokens can be found in the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". The documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.

ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[]) ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])

Returns a runtime field handle for the field identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope.

public:
 RuntimeFieldHandle ResolveFieldHandle(int fieldToken, cli::array <RuntimeTypeHandle> ^ typeInstantiationContext, cli::array <RuntimeTypeHandle> ^ methodInstantiationContext);
public RuntimeFieldHandle ResolveFieldHandle (int fieldToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext);
member this.ResolveFieldHandle : int * RuntimeTypeHandle[] * RuntimeTypeHandle[] -> RuntimeFieldHandle
Public Function ResolveFieldHandle (fieldToken As Integer, typeInstantiationContext As RuntimeTypeHandle(), methodInstantiationContext As RuntimeTypeHandle()) As RuntimeFieldHandle

Parameters

fieldToken
Int32 Int32 Int32 Int32

A metadata token that identifies a field in the module.

typeInstantiationContext
RuntimeTypeHandle[]

An array of RuntimeTypeHandle structures representing the generic type arguments of the type where the token is in scope, or null if that type is not generic.

methodInstantiationContext
RuntimeTypeHandle[]

An array of RuntimeTypeHandle structures representing the generic type arguments of the method where the token is in scope, or null if that method is not generic.

Returns

Exceptions

metadataToken is not a valid token in the scope of the current module.

-or-

metadataToken is not a token for a field in the scope of the current module.

-or-

metadataToken identifies a field whose parent TypeSpec has a signature containing element type var or mvar.

Remarks

Note

Information about metadata tokens can be found in the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics". The documentation is available online; see ECMA C# and Common Language Infrastructure Standards on MSDN and Standard ECMA-335 - Common Language Infrastructure (CLI) on the Ecma International Web site.

Applies to