We found some strange behavior connected with custom attributes.
Given this attribute:
public class MyAttribute : Attribute
{
public MyAttribute(bool b = false, params int[] a)
{
}
}
And this usage:
class Program
{
[MyAttribute]
static void Main()
{
Console.ReadKey();
}
}
We get the exception:
System.Reflection.CustomAttributeFormatException: Binary format of the specified custom attribute was invalid.
Why does this happen?