VB.NET class inherits a base class and implements an interface issue (works in C#)

后端 未结 7 1714
后悔当初
后悔当初 2020-12-09 14:53

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. T

7条回答
  •  没有蜡笔的小新
    2020-12-09 15:26

    This is a strange issue and it clearly shows a difference between the C# and VB.NET compilers. I would suggest that you do implement the interface on the abstract base class as this will make the VB.NET compiler happy and at execution time your child class will still have metadata indicating that it does in fact implement IFoo.

    Is there a specific reason that the child class must be the one to declare that it implements the interface?

提交回复
热议问题