C
Chango V.
Hello,
I have multiple instances of a custom attribute class applied to a field.
The problem is Type.GetCustomAttributes() returns them in a different order
than declared. The documentation seems to say that there is no defined order
for custom attributes, but it's really important for me to get them in the
declared order. What's funny is that if I try to rearrange them and
recompile, I will be able to see them at runtime just in the declared order.
But after I recompile once or twice more, without changing the attribute
declarations (maybe only something else in the code), the order gets
randomized! And then this seemingly random order persists.
Is there some particular implementation detail about custom attributes that
could help me figure out what's going on and, hopefully, solve my problem?
Any hint will be appreciated.
Thanks.
//
I have multiple instances of a custom attribute class applied to a field.
The problem is Type.GetCustomAttributes() returns them in a different order
than declared. The documentation seems to say that there is no defined order
for custom attributes, but it's really important for me to get them in the
declared order. What's funny is that if I try to rearrange them and
recompile, I will be able to see them at runtime just in the declared order.
But after I recompile once or twice more, without changing the attribute
declarations (maybe only something else in the code), the order gets
randomized! And then this seemingly random order persists.
Is there some particular implementation detail about custom attributes that
could help me figure out what's going on and, hopefully, solve my problem?
Any hint will be appreciated.
Thanks.
//