默认程序集绑定行为
我们正在构建一个存储在程序集中的 API,我们将其称为 MyAssembly.dll
该程序集的 AssemblyVersion 为 1.0.0.0
我希望在发布程序集的新版本时,以前编译的代码会引用 1.0.0.0版本会中断,因为程序集绑定会失败(没有像bindRedirect这样的额外帮助)。
在实践中,我看到的是绑定实际上成功了。
我已经通过构建具有各种不同版本的 MyAssembly.dll 并尝试运行引用 1.0.0.0 的各种代码来测试它,
这是默认行为吗?到EXACT版本的绑定是否仅发生在强名称(签名)程序集中?
谢谢。
We are building an API that is stored in an assembly, let's call it MyAssembly.dll
This assembly has an AssemblyVersion of 1.0.0.0
I would expect, that when releasing a new version of the assembly, previous code that compiled referencing to 1.0.0.0 version would break, since the assembly binding would fail (without some extra help like bindRedirect).
In practice, what i see is is the binding actually succeeds.
I have tested it by building a MyAssembly.dll with various different versions, and trying to run various code that was referencing 1.0.0.0
Is this the default behaviour? Does binding to the EXACT version occur only from strong-name (signed) assemblies?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
运行
时如何定位程序集 ”默认情况下,运行时尝试与构建应用程序所使用的程序集的确切版本进行绑定。此默认行为可以通过配置文件设置覆盖。”
(...)
“注意:没有对没有强名称的程序集进行版本检查,运行时也不会在全局程序集缓存中检查没有强名称的程序集。”
How the runtime locates assemblies
"By default, the runtime attempts to bind with the exact version of an assembly that the application was built with. This default behavior can be overridden by configuration file settings."
(...)
"Note: There is no version checking for assemblies without strong names, nor does the runtime check in the global assembly cache for assemblies without strong names."