Metadata Validity Rules

Metadata Validity Rules

A record of the CustomAttribute table has three entries: Parent, Type, and Value. The metadata validity rules for the custom attributes are rather simple:

  • The Parent entry must hold a valid index to one of the following tables: Module, TypeRef, TypeDef, Field, Method, Param, InterfaceImpl, MemberRef, DeclSecurity, StandAloneSig, Event, Property, ModuleRef, TypeSpec, Assembly, AssemblyRef, File, ExportedType, or ManifestResource.

  • The Type entry must hold a valid index to the Method or MemberRef table, and the indexed method must be an instance constructor.

  • The Value entry must hold either 0 or a valid offset in the #Blob stream.

  • The blob indexed in the Value entry must be encoded according to the rules described earlier in this chapter; see “Custom Attribute Value Encoding.”

  • The fields and properties listed in the name/value pairs of the Value blob must be accessible from the custom attribute owner (referenced in the Parent entry).



Inside Microsoft. NET IL Assembler
Inside Microsoft .NET IL Assembler
ISBN: 0735615470
EAN: 2147483647
Year: 2005
Pages: 147
Authors: SERGE LIDIN

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net