dimanche 20 mars 2016

Where is Type.GetCustomAttributes method in CoreCLR?

I am trying to get attributes from a class, and it seems that there is no GetCustomAttributes method. How to obtain attributes in CoreCLR?

using System.Reflection;

class FooBar {
    FooBar() {
        GetType().GetCustomAttributes(); // does not compile
        GetType().GetField("test").GetCustomAttributes(); // compiles
    }
}





Aucun commentaire:

Enregistrer un commentaire