Backward compatibility when changing a base class

In .NET, do I support binary compatibility when I set up a new base class for a class that previously did not have a base class (inherited from System.Object)?

+1
source share
2 answers

A quick test suggests that everything is in order, but personally I would be very nervous about this without recompiling. Basically, you are in a state that cannot be reproduced from the source code without going through the same steps - create a library, create a calling code, change the library, rebuild only the library code.

Behavior can change in a subtle way with things like extension methods and overloading. It is much cleaner if you can rebuild the entire calling code, so that you are on a firmer footing when it comes to debugging, etc. If you find an error in some interaction between the library and the calling code, you will have to be very careful with how you analyzed, tested and debugged it, if you could not just rebuild everything and get the same results.

+3
source

There should be no problem if the base class somehow alters the old behavior.

+2
source

All Articles