다음을 통해 공유


MemberInfo.MetadataToken Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets a value that identifies a metadata element.

Namespace:  System.Reflection
Assembly:  mscorlib (in mscorlib.dll)

Syntax

'Declaration
Public Overridable ReadOnly Property MetadataToken As Integer
public virtual int MetadataToken { get; }

Property Value

Type: System.Int32
A value which, in combination with Module, uniquely identifies a metadata element.

Exceptions

Exception Condition
InvalidOperationException

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 ModuleBuilder.GetMethodToken method; or use the ModuleBuilder.GetArrayMethodToken method to get the token directly, instead of using the ModuleBuilder.GetArrayMethod method to get a MethodInfo first.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.