title: Should a protected property in a C# child class hide access to a public property on the parent?
body: <p>I have the following code:</p>
  
  <pre><code>public class Parent
  {
      public string MyField { get; set; }
  }
  
  public class Child : Parent
  {
      protected new int MyField { get; set; }
  }
  </code></pre>
  
  <p>I try and access this with:</p>
  
  <pre><code>static void Main(string[] args)
  {
      Child child = new Child();
      child.MyField = "something";
  }
  </code></pre>
  
  <p>Visual studio 2008 compiles this without comment, but under Mono (2.4.2, Ubuntu) I get the error message </p>
  
  <pre><code>'HideTest.Child.MyField' is inaccessible due to its protection level (CS0122)
  </code></pre>
  
  <p>Is one implementation or the other more compliant with the standard here?</p>
  
  <p><strong>Edit:</strong> Thanks to all the people who have pointed out the bad design. Unfortunately it's a third-party library and changing it significantly isn't practical.</p>