This documentation is archived and is not being maintained.

PropertyInfo Class

Discovers the attributes of a property and provides access to property metadata.

For a list of all members of this type, see PropertyInfo Members.


[Visual Basic]
MustInherit Public Class PropertyInfo
   Inherits MemberInfo
public abstract class PropertyInfo : MemberInfo
public __gc __abstract class PropertyInfo : public MemberInfo
abstract class PropertyInfo extends MemberInfo

Thread Safety

This type is safe for multithreaded operations.


Properties are logically the same as fields. A property is a named aspect of an object's state whose value is typically accessible through get and set accessors. Properties may be read-only, in which case a set routine is not supported.

Several methods in this class assume that the getter and setter methods of a property have certain formats. The signatures of the get and set methods must match the following convention:

  • The return type of the getter and the last argument of the setter must be identical. This is the type of the property.
  • The getter and setter must have the same number, type, and order of indices.

If this format is not followed, the behavior of the GetValue and SetValue methods is undefined.

Calling ICustomAttributeProvider.GetCustomAttributes on PropertyInfo when the inherit parameter of GetCustomAttributes is true does not walk the type hierarchy. Use System.Attribute to inherit custom attributes.

Notes to Inheritors:  When you inherit from PropertyInfo, you must override the following members: GetValue, SetValue, GetAccessors, GetGetMethod, GetSetMethod, and GetIndexParameters.


Namespace: System.Reflection

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: Mscorlib (in Mscorlib.dll)

See Also

PropertyInfo Members | System.Reflection Namespace