Rules for C# class backward compatibility/avoiding breaking changes

后端 未结 3 1482
误落风尘
误落风尘 2021-02-02 10:34

I\'m working on a C# 3.5 assembly that is consumed by many different applications in an enterprise server environment. I would like to add some properties to an existing C# clas

3条回答
  •  深忆病人
    2021-02-02 11:04

    At his point error that you are getting is not related to compatibility between classes, but rather problem loading assembly - see The located assembly's manifest definition does not match the assembly reference if it helps.

    Adding properties/methods to exisitng class should be ok for backward compatibility. Removing fields/methods/properties, changing class to struct, changing base class is definitely not. Modifying constants, enum values is dangerous.

提交回复
热议问题