Hi. I was working with attributes and fund a behavior that I cannot understand. I created a CustomAttribute MyAttribute that has getter and setter properties for a private field. This field is initialized with the constructor. Also the attribute is only used with properties (AttributeTargets.Property).
During my experimentation I realized I can use de setter properties in the MyAttribute to set the value for a new one. This seems to work, until I try to get the MyAttribute again from the same property on the same instance. The value is the one that was set with the ctor. My understanding of attributes is small so at first I thought I would never be allowed to use the setter property in MyAttribute or change any value whatsoever. An even after I was allowed to change the private field inside MyAttribute, why was the value not preserved the next time I searched for that same attribute in the same class instance? Thanks!