Does the new base class (which inherits the old base class) inherit a violation?

I have a LegacyClass class that inherits from OldBaseClass.

I am considering a change to introduce a new class between them so that

LegacyClass inherits from NewBaseClass AND NewBaseClass inherits from OldBaseClass.

Neither NewBaseClass nor OldBaseClass are abstract. Will this change assembly assembly compatibility for older MSIL collectors that depend on (and possibly even inherit from) LegacyClass?

+4
source share
1 answer

As stated in this answer , this should be good if you are not actually modifying any existing behavior (and, more specifically, depending on how that behavior changes). If all the new class does is add new (separate) methods / properties, then you should be fine. However, as is usually the case, it depends. Consider the following issues:

  • Who uses your assembly (outsiders or only those who are part of your organization)?
  • Can you recompile customers?
  • Can you run automatic or manual unit tests for these clients?
  • Do you want to add or change the functionality of your LegacyClass?
+3
source

All Articles