How to override a property in a non-following class?

In the MSDN documentation, System.Reflection.Assembly has the CodeBase property, which is defined as overridable.

Public Overridable ReadOnly Property CodeBase As String

However, if I try to create a new class that inherits from System.Reflection.Assembly, I get an error message that tells me that it cannot be inherited. So how can I override this property?

+3
source share
2 answers

Unfortunately, you cannot do this.

Although the class itself is Assemblydeclared as public, it provides only a constructor internal. This actually means that it can only be created (or inherited) only from the mscorlib native assembly.

+5

, . Assembly sealed (NotInheritable VB.NET), ; internal (Friend VB.NET). , , , ( mscorlib).

+3

Source: https://habr.com/ru/post/1720553/


All Articles