vendredi 14 août 2015

How to get custom attributes of class in referenced dll

How to get custom attributes of class in referenced dll. Class of myObject is defined in an external dll, which is referenced in my current project where I wrote following,

myObject.GetType().GetProperties(BindingFlags.Instance | BindingFlags.Public)
 .Where(prop => prop.GetCustomAttributes(typeof(ExportToXmlAttribute), false).Length > 0).ToList()

This is not working.





Aucun commentaire:

Enregistrer un commentaire