title: VB.NET class inherits a base class and implements an interface issue (works in C#)
body: <p>I am trying to create a class in VB.NET which inherits a base abstract class and also implements an interface. The interface declares a string property called Description. The base class contains a string property called Description. The main class inherits the base class and implements the interface. The existence of the Description property in the base class fulfills the interface requirements. This works fine in C# but causes issues in VB.NET.</p>
  
  <p>First, here is an example of the C# code which works:</p>
  
  <pre><code>public interface IFoo
  {
      string Description { get; set; }
  }
  
  public abstract class FooBase
  {
      public string Description { get; set; }
  }
  
  public class MyFoo : FooBase, IFoo
  {
  }
  </code></pre>
  
  <p>Now here is the VB.NET version which gives a compiler error:</p>
  
  <pre class="lang-vb prettyprint-override"><code>Public Interface IFoo
      Property Description() As String
  End Interface
  
  Public MustInherit Class FooBase
      Private _Description As String
      Public Property Description() As String
          Get
              Return _Description
          End Get
          Set(ByVal value As String)
              _Description = value
          End Set
      End Property
  End Class
  
  Public Class MyFoo
      Inherits FooBase
      Implements IFoo
  End Class
  </code></pre>
  
  <p>If I make the base class (<code>FooBase</code>) implement the interface and add the <code>Implements IFoo.Description</code> to the property all is good, but I do not want the base class to implement the interface.</p>
  
  <p>The compiler error is:</p>
  
  <blockquote>
    <p>Class 'MyFoo' must implement 'Property Description() As String' for interface 'IFoo'. Implementing property must have matching 'ReadOnly' or 'WriteOnly' specifiers.</p>
  </blockquote>
  
  <p>Can VB.NET not handle this, or do I need to change my syntax somewhere to get this to work?</p>