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.GetCustomAttribute(typeof(Failer).GetProperty("Prop"), typeof(FailerAttr)); } }