向后兼容性插件架构的.Net 程序集版本号
我有一个 .Net 系统,第三方在引用提供的 API 程序集时可以扩展该系统。我担心的是向后兼容性,即我需要确保每当 对提供的 API 程序集进行二进制非破坏性更改(例如添加方法):
- 使用旧版本构建的插件在运行新版本时应该仍然可以工作。
- 但是,使用新版本构建的插件在运行旧版本时不应该工作(否则,如果插件尝试调用不存在的方法,这可能会导致运行时失败)
由于第二个要求,我不能简单地保留版本号相同 - 我知道满足要求 1. 的唯一方法是使用 绑定重定向,需要维护一个长列表所有 API 程序集的所有先前版本号。这似乎容易出错且乏味。
在处理 .Net 程序集版本号时,是否有任何替代策略可以保持合理的向后兼容性?
I have a .Net system which 3rd parties can extend when they reference supplied API assemblies. My concerns are with backwards compatability, namely I need to ensure that whenever binary non-breaking changes are made to the supplied API assemblies (for example a method is added):
- Plugins built using the old version should still work when running the new version.
- However plugins built using the new version should not work when running the old version (as otherwise this may lead to runtime failures if the plugin tries to call a method that doesn't exist)
Because of the second requirement I can't simply keep the version numbers the same - the only way I then know of then satisfying requirement 1. is by using binding redirection which requires maintaining a long list of all previous version numbers for all API assemblies. This seems error-prone and tedious.
Is there any alternative strategies for maintaining sensible backwards compatability when dealing with .Net assembly version numbers?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论