using System; using System.Reflection; class FailerAttr : Attribute { public FailerAttr(string s) { throw new Exception("I should definitely fail!"); } } public class Test { private class Failer { [FailerAttr("")] public int Prop { get; set; } } public static void Main() { Attribute.GetCustomAttributes(typeof(Failer).GetProperty("Prop")); } }