始终从 GAC 获取最新的 dll
我们有一个版本为 1.0.1.* 的 dll,许多本身在不同计算机上运行的应用程序都使用它。该 dll 驻留在运行应用程序的计算机的 GAC 中。应用程序包含此 dll 作为引用,并将“特定版本”设置为 false。我们已经推出了该 dll 的 1.0.2.* 版本,它向后兼容。
有没有办法部署新的 dll 并要求所有应用程序选择最新版本,而无需重新编译应用程序。我知道使用发布者策略进行程序集重定向。还有别的办法吗?
We have a dll with version 1.0.1.* that is used by many applications whcih themselves run on different machines. This dll resides in the GAC of the machine running the application. The application includes this dll as a reference with "Specific Version" set to false. We have come up with version 1.0.2.* of this dll which is backward compatible.
Is there a way to deploy the new dll and ask all the applications to pick the latest version without having to recompile the applications. I am aware of assembly redirection using Publisher Policy. Is there another way?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
发布商政策是明确设计用于执行此操作的,不考虑它来解决您的问题没有多大意义。鉴于您的更新是“向后兼容”的,一种简单的方法是不更改 [AssemblyVersion],而仅增加 [AssemblyFileVersion]。
A publisher policy is explicitly designed to do this, not considering it to solve your problem doesn't make a lot of sense. Given that your update is 'backward compatible', a no-hassle approach would be to simply not change the [AssemblyVersion] but only increment the [AssemblyFileVersion].
您可以在 web.config 中添加新的 AssemblyBinding 元素:
You can add a new AssemblyBinding element in your web.config: