Hello everyone,
Two questions related to meta data and attribute,
1.
.Net built-in and user defined attribute are both defined in meta data portion of assembly or not? In my past experience, I think method/class level attribute is only used to facilitate the method/class IL generation, and will not exist in final assembly file. Any comments?
2.
If .Net built-in and user defined attribute exist in the final meta data part of assembly, is it possible to use reflector to see them? (I have tried but can not find.)
thanks in advance,
George
George GeorgePosted May 25, 2008, 7:32 AM
Great reply, Bechir!
I have tried that Ctrl+M shows Meta Info. I think Meta Info including attribute (i.e. attribute is a part of meta data information), and meta data information should include more information beyond attribute, right?
regards,
George
Bechir BejaouiPosted May 25, 2008, 4:13 AM
to exlore attribute you may use reflection
using System.Reflection;
Assembly a = Assembly.Load("AssemblyName");
Type t = Type.GetType("a.typeName");
Object[] Attributes = t.GetAttributes();
and then you can get info about them
you can make use of the ildasm.exe there is a useful short cut Ctrl + M that gives you some details about meta data within a given assembly