How do I get the custom attribute value of a field? [duplicate]
This question already has an answer here: Getting the attributes of a field using reflection in C# 1 answer I am using FileHelpers to write out fixed length files. public class MyFileLayout { [FieldFixedLength(2)] private string prefix; [FieldFixedLength(12)] private string customerName; public string CustomerName { set { this.customerName= value; **Here I require to get the customerName's FieldFixedLength attribute value** } } } As shown above, I would like a access the custom attribute value inside the set method of the property. How do I achieve this? MSTdev You can do this using reflection