Enumerate Assembly Attributes?

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

xenophon

How to do? I can enumerate them for types in an assembly, but not on
an assembly itself.

Thanks.
 
Get hold of an assembly reference with by:

Assembly.GetExecutingAssembly();
obj.GetType().Assembly;
Assembly.Load/From();

depending how your code relates to the assembly in question

Regards

Richard Blewett - DevelopMentor
http://www.dotnetconsult.co.uk/weblog
http://www.dotnetconsult.co.uk

How to do? I can enumerate them for types in an assembly, but not on
an assembly itself.

Thanks.
 
Hi

In addition, you may try the code below.

Assembly ass = Assembly.GetExecutingAssembly(); //Get the assembly
reference.
object[] objs =ass.GetCustomAttributes(true);//enum the attribute


Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Is there a way to get this info from another assembly in the asm cach
without loading it first?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top