MemberInfo.MetadataToken Property
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.
Gets a value that identifies a metadata element.
public:
virtual property int MetadataToken { int get(); };
public virtual int MetadataToken { get; }
member this.MetadataToken : int
Public Overridable ReadOnly Property MetadataToken As Integer
Property Value
A value which, in combination with Module, uniquely identifies a metadata element.
Exceptions
The current MemberInfo represents an array method, such as Address
, on an array type whose element type is a dynamic type that has not been completed. To get a metadata token in this case, pass the MemberInfo object to the GetMethodToken(MethodInfo) method; or use the GetArrayMethodToken(Type, String, CallingConventions, Type, Type[]) method to get the token directly, instead of using the GetArrayMethod(Type, String, CallingConventions, Type, Type[]) method to get a MethodInfo first.
Remarks
The tokens obtained using this property can be passed to the unmanaged reflection API. For more information, please see Unmanaged Reflection API.
Note
Using the unmanaged reflection API requires familiarity with the Common Language Infrastructure (CLI) documentation, especially "Partition II: Metadata Definition and Semantics" and "Partition III: CIL Instruction Set". For more information, see ECMA 335 Common Language Infrastructure (CLI).
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기