Visual Studio参考和版本控制 - 它如何工作? [英] Visual Studio References and versioning - how does it work?

查看:161
本文介绍了Visual Studio参考和版本控制 - 它如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有几个常见的库。理想情况下,我们希望所有人都使用最新版本的dll,即使它们是根据较旧的不同版本编译的(假设最新版本是向后兼容的)



例如我们有:



项目dll

常用控件dll

记录dll

数据库访问dll



数据库dll的项目和公共控件参考v2。日志记录,但参考v1。



如果不同的组件引用不同的版本,VS会如何选择使用哪一个?

我们必须重新编译v1 dll才能使用最新的数据库(v2),或者我们可以自动获取这些数据吗?

是否可以强制使用特定版本?



谢谢,



Alex

解决方案

默认情况下,对于版本化的DLL,我相信VS会强制完全匹配。但是,如果您查看引用的属性,您会发现一个名为特定版本的属性。将其设置为false,它将与以后的版本相匹配。



不幸的是,我没有VS的完整版本与我找到合适的MSDN链接。 / p>

此外,您可以使用 assemblyBinding 元素。


We have several common libs. Ideally we want them all to use the latest version of a dll even if they have been compiled against an older different version (assume the latest version is backward compatible)

e.g we have:

Project dll
Common controls dll
Logging dll
Database access dll

Project and common controls reference v2 of database dll. Logging however references v1.

If different versions are referenced in different components how does VS pick which one to use?
Do we have to recompile v1 dll to use the latest database (v2) or can we get this to pick up automatically?
Is it possible to force a particular version to be used?

Thanks,

Alex

解决方案

By default, for versioned DLLs I believe VS will force an exact match. If you look in the properties of the reference, however, you'll find a property called "Specific Version". Set that to "false" and it will match later versions.

I don't have the full version of VS with me to find an appropriate MSDN link, unfortunately.

In addition, you can use the assemblyBinding element in app.config.

这篇关于Visual Studio参考和版本控制 - 它如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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