ModuleHandle.ResolveFieldHandle Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns a runtime field handle for a field identified by a metadata token.
Overloads
ResolveFieldHandle(Int32) |
Returns a runtime handle for the field identified by the specified metadata token. |
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)
- Source:
- RuntimeHandles.cs
- Source:
- RuntimeHandles.cs
- Source:
- RuntimeHandles.cs
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
A metadata token that identifies a field in the module.
Returns
A RuntimeFieldHandle for the field identified by fieldToken
.
Exceptions
fieldToken
is not a valid token in the scope of the current module.
-or-
fieldToken
is not a token for a field in the scope of the current module.
-or-
fieldToken
identifies a field whose parent TypeSpec
has a signature containing element type var
or mvar
.
The method is called on an empty field handle.
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".
Applies to
ResolveFieldHandle(Int32, RuntimeTypeHandle[], RuntimeTypeHandle[])
- Source:
- RuntimeHandles.cs
- Source:
- RuntimeHandles.cs
- Source:
- RuntimeHandles.cs
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);
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
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
A RuntimeFieldHandle for the field identified by fieldToken
.
Exceptions
fieldToken
is not a valid token in the scope of the current module.
-or-
fieldToken
is not a token for a field in the scope of the current module.
-or-
fieldToken
identifies a field whose parent TypeSpec
has a signature containing element type var
or mvar
.
The method is called on an empty field handle.
fieldToken
is not a valid token.
Remarks
Note
Information about metadata tokens can be found in the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics".
Applies to
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for