Read Attributes without Instancing?

  • Thread starter Thread starter xenophon
  • Start date Start date
X

xenophon

I have an assembly with a Type decorated with Role-Based security
attrbutes. How can I read the attributes from the Type without
instancing it?

Thanks.
 
You can access this through reflection. Try

System.Reflection.MemberInfo inf = typeof(MyClass);
object[] attributes = inf.GetcustomAttributes(typeof(MyAttribute), false);

Hope that helps.
 
Back
Top