.NET:相对于的AssemblyVersion,什么定义二进制兼容性? [英] .NET: with respect to AssemblyVersion, what defines binary compatibility?

查看:151
本文介绍了.NET:相对于的AssemblyVersion,什么定义二进制兼容性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要什么样的变化一个强命名程序集在必要一个AssemblyVersionAttribute变化?显然,改变可能要求客户端必须修改代码的方式公共API需要的AssemblyVersion的增加。但对于修改不需要在客户端代码改变公共API?例如:

What changes to a strong-named assembly necessitate a change in AssemblyVersionAttribute? Clearly, changing the public api in a way that could require a client to have to make a code change requires an increase in AssemblyVersion. But what about changes to the public API that don't require code changes in the client? For instance:


  • 增加一个公共类或接口

  • 增加了一个公共的?成员公共类或接口? (编辑:。drscroogemcduck正确地指出下面,添加一个成员的接口将软管所有实施者我傻)

  • 增加了一个类成员的能见度
  • $ B的? $ b
  • the addition of a public class or interface?
  • the addition of a public member to a public class or interface? ( drscroogemcduck correctly points out below that adding a member to an interface would hose all implementors. Silly me.)
  • an increase of visibility of a class member?

有一定是在某个地方,在MSDN上的最终文件(或MS知道,在某些MSSE的个人博客)。但我根本无法找到它。请帮助!

There's got to be definitive documentation of this somewhere on MSDN (or, knowing MS, on some MSSE's personal blog). But I simply cannot find it. Please help!

推荐答案

这是很容易...只要类型保持不变(在他们的公共或受保护的布图设计)和方法签名不改变(添加方法或类型是罚款),JIT的应该是能够将DLL就好了链接。

It's pretty easy... as long as Types remain unchanged (in their public or protected layout) and method signatures are not changed (adding methods or types is fine), the JIT should be able to link the DLL just fine.

这是说,我认为,即使它确实的工作,你的不应该的做到这一点。创建一个新的版本,并使用一个策略,以旧版本映射到新的,如果需要的话。否则,你自己开车直接回到地狱DLL ...我敢肯定,你不希望出现这种情况。

That said, I think that even if it does work you should not do this. Make a new version and use a policy to map the old version to the new one, if required. Otherwise you drive yourself straight back to DLL hell... and I'm pretty sure you don't want that.

这篇关于.NET:相对于的AssemblyVersion,什么定义二进制兼容性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆