title: Override an inherited class attribute in a subclass
body: <p>There's a fine <a href="https://stackoverflow.com/questions/3840196/c-sharp-override-an-attribute-in-a-subclass">question</a> on overriding inherited attributes of properties.</p>
  
  <p>Suppose an attribute:</p>
  
  <pre><code>[AttributeUsage(AttributeTargets.All, Inherited = true)]
  public class MyAttributeAttribute : Attribute
  
  //...
  
  public class ParentClass
  {
      [MyAttribute]
      public String MyString;
  }
  
  public class ChildClass : ParentClass
  {
      new public String MyString; //Doesn't have MyAttribute
  }
  </code></pre>
  
  <p>But what if <code>MyAttribute</code> is set to a class?</p>
  
  <pre><code>[MyAttribute]
  public class ParentClass
  
  public class ChildClass; //Don't want MyAttribute
  </code></pre>
  
  <p><strong>Is there a way to make ChildClass not inherit the attribute?</strong></p>
  
  <hr>
  
  <p>Context: Purely theoretical. I want to make an attribute inheritable and want to know, if the case happens some day, if I can override it.</p>