A
Andreas Mueller
Hi all,
I have an attribute class:
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
class MyAttribute : Attribute
{
public MyAttribute(){ }
}
In one assembly I define the attribute multiple times:
[assembly: MyAttribute()]
[assembly: MyAttribute()]
[assembly: MyAttribute()]
Then I try to access the attributes:
Assembly assembly = this.GetType().Assembly;
object[] att = assembly.GetCustomAttributes(typeof(MyAttribute), true);
Assert.AreEqual(att.Length, 3);//Fails
It only returns the attribute one time. Am I doing something wrong, or
is this simply not possible?
Thanks in advance,
Andy
I have an attribute class:
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
class MyAttribute : Attribute
{
public MyAttribute(){ }
}
In one assembly I define the attribute multiple times:
[assembly: MyAttribute()]
[assembly: MyAttribute()]
[assembly: MyAttribute()]
Then I try to access the attributes:
Assembly assembly = this.GetType().Assembly;
object[] att = assembly.GetCustomAttributes(typeof(MyAttribute), true);
Assert.AreEqual(att.Length, 3);//Fails
It only returns the attribute one time. Am I doing something wrong, or
is this simply not possible?
Thanks in advance,
Andy