I’m trying to read all attributes of a methode which contains more than one attribute of the same type like:
[field(Feld = "x86", Index = 1)]
[field(Feld = "x93", Index = 2)]
...
[field(Feld = "x107", Index = 9)]
public string Methodename() {}
Reading the Attribute like:
Attribute mAttr = Attribute.GetCustomAttribute
(methodInfo, typeof (fieldAttribute), false) as fieldAttribute;
This throwing an AmbiguousMatchException. How do i read more than one attribute?
Thank you
Use GetCustomAttributes instead of GetCustomAttribute 🙂
For example: