项目参考DLL版本地狱 [英] Project References DLL version hell

查看:125
本文介绍了项目参考DLL版本地狱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

获取视觉工作室从我们的一个项目中获取最新版本的DLL时遇到问题。



我们有多个类库项目(例如BusinessLogic,ReportData)和一些Web服务,每个都有对我们编写的Connectivity DLL的引用(本参考连接DLL是问题)。



我们总是指向bin / debug文件夹中的DLL引用(这是我们始终为任何给定项目构建的)并且所有自定义DLL引用都具有CopyLocal = True和SpecificVersion = False



ReportData具有对业务逻辑的引用(这也引用了连接性 - 我不明白为什么这应该会导致一个问题,但是以为值得一提)



奇怪的是,当您点击添加参考并浏览到Connectivity / bin / debug将鼠标悬停在DLL文件上,显示正确的(最新)版本(版本和文件版本总是递增在一起),但是当您单击确定时,先前的版本号被拉。即使我查看当前项目的调试文件夹(其中copy本地将编译后的DLL)显示最新版本号。 - 不,我可以在visual studio之外找到以前版本的DLL,但在该项目中,引用它具有旧版本 - 即使路径正确。



我可能会从旧版本中获取旧版本。或者甚至为什么要这样一个。



这可能是我遇到的最大的问题。



有谁知道如何确保最新版本被拉过(最好自动或编译)。



编辑:



尽管我正在处理的情况并不完全正在阅读这个文章和某个地方它提到关于CLR忽略修订号。可以理解(即使这不是一个问题 - 我们在修改39),所以我以为我会更新版本号,仍然没有工作。我尝试一下,尽管我会更新次要版本号,看看是否有所差异。



我不是说这是答案,因为我必须检查相当多的事情首先,但面对它,这似乎已经解决了我的问题...



进一步编辑:
在其他类库中似乎已经解决了这个问题,但是在测试Windows应用程序中,它仍然通过以下方式提取了以前的版本:(



如果我再次增加次要版本号,同样的问题来了返回,我被遗忘了错误的版本被拉。



进一步编辑 - 我创建了一个新的项目,添加了一个参考,仍然有完全相同的问题。建议问题被限制在我引用的项目中,希望我知道为什么!



以前有人有这个问题,知道如何解决? b
$ b

帮助!

解决方案

为了克服这个,我删除了EVER Y参考,然后再重新添加。我不知道为什么这是解决方案。



可能在一个项目中DLL是不正确的,这是不正确的DLL通过视觉工作室和使用。



编辑:
发生此错误的其他时间是由于当前项目中引用的DDL(A)也被另一个引用DLL(B)。不重建这个其他DLL(B)似乎阻止VS引用当前项目中的正确版本的DLL(A),因此它带来了较旧版本的DLL(A)。


We're having problems getting visual studio to pick up the latest version of a DLL from one of our projects.

We have multiple class library projects (e.g. BusinessLogic, ReportData) and a number of web services, each has a reference to a Connectivity DLL we've written (this ref to the connectivity DLL is the problem).

We always point references to the DLL in the bin/debug folder, (which is where we always build to for any given project) and all custom DLL references have CopyLocal = True and SpecificVersion = False

ReportData has a reference to business logic (which also has a reference to connectivity - I don't see why this should cause a problem, but thought it is worth mentioning)

The weird thing is, when you click "Add Reference" and browse to Connectivity/bin/debug - you hover the mouse over the DLL file, the correct (latest) version is shown (version and file version are always incremented together), but when you click ok, a previous version number is pulled though. Even when I look in the current projects debug folder (where copy local would put the DLL after compiling) that shows the latest version number. - NO WHERE does can I find the previous version of the DLL outside of visual studio, but in that project references it has the old version - even though the path is correct.

I'm at a loss as to where it might be getting the old versions from. Or even why it wants that one.

This is possibly the most frustraighting problem I have ever come across.

Does anyone know how to ensure the latest version is pulled through (preferably automatically or on compile).

EDIT:

Although not exactly the scenario I'm dealing with I was reading this article and somewhere it mentions about CLR ignoring revision numbers. Understandable (even though this hasn't been a problem before - we're on revision 39), so I thought I would update the build number, still didn't work. In a vain attempt I though I would update the minor version number and see if that made any difference.

I'm not saying this is the answer as I have to check quite a few things first, but on the face of it, this seems to have solved my problem...

Further edit: In other class libraries this seems to have solved the problem, however in a test windows application it still pulls a previous version through :(

If I increment the minor version number again, the same problem come back and I am left with the wrong version being pulled though.

Further Edit - I created an entirly new project, added a reference and still had the exact same problem. This suggests the problem is restriced to the project I am referencing. Wish I knew why!

Anyone had this problem before and know how to get around it?

HELP!

解决方案

To overcome this, I removed EVERY reference, then added them all back in again. I don't know why this is the solution.

It is possible that in one project a DLL was incorrect, and it is this incorrect DLL that was pulled through by visual studio and used.

Edit: Other times this error has occurred is due to a DDL (A) being referenced in the current project also being referenced by another DLL (B). Not rebuilding this other DLL (B) seems to prevent VS from referencing the correct version of DLL (A) in the current project and thus it brings through an older version of DLL (A).

这篇关于项目参考DLL版本地狱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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