.NET参考specificversion真的还是假的? [英] .net reference specificversion true or false?

查看:1964
本文介绍了.NET参考specificversion真的还是假的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们两家公司谁是工作在同一个项目中,同一个应用程序。每周我们交流的我们的组件(未在code)以及相互引用的DLL。

We are two companies who are working on the same project, in the same application. On a weekly basis we exchange only our assemblies (not the code) and reference each other's dll.

什么是添加引用到我们的项目的时候就 specificversion 的最佳做法。 特别是,当我们应该使用的 specificversion 值的 的和在什么情况下,我们应该使用的 的。

What is the best practice regarding the specificversion when adding reference to our project. Specifically, when should we use a specificversion value of true and in what case should we use false.

推荐答案

这答案是要根据您版本的DLL文件的假设。

This answer is going to be based on the assumption that you are versioning your dlls.

如果您设置SpecificVersion为true(这是默认添加引用的时候),那么该项目将参照该DLL与特定版本(说,例如1.0.0.0)。如果,在以后的时间,你就赋予了新的DLL(比如1.0.1.0),那么你将需要删除旧的DLL引用,并添加了新的参考。这是因为该项目是专门找1.0.0.0当你有一个新版本1.0.1.0。

If you set SpecificVersion to true (which is the default when adding a reference), then the project will reference to that dll with a particular version (say for instance 1.0.0.0). If, at a later time, you're given a new dll (say 1.0.1.0), then you will have to remove the old dll reference and add the new reference. This is because the project is specifically looking for 1.0.0.0 when you have a new version 1.0.1.0.

另一种情况是设置SpecificVersion为false,它告诉该项目,以找到最新的DLL和使用该之一。这里的问题是,该项目现在需要在不同的地方为你引用的DLL,它可以增加你的编译时间追捕。它会做到这一点,即使它知道你引用的DLL的路径。我不知道这是否是一个错误,或者如果这是由设计完成的。它可能会检查,看看是否有任何新的dll除了一个你所引用的(也许在GAC或其他地方)。

The alternative to this is to set the SpecificVersion to false, which tells the project to find the latest available dll and use that one. The problem with this is that the project is now required to "hunt" in various places for the dll you've referenced, which can increase your build time. It will do this even though it knows the path of the dll you've referenced. I'm not sure if this is a bug or if this is done by design. It might be checking to see if there are any newer dlls besides the one you've referenced (perhaps in the GAC or elsewhere).

下面是一个<一href="http://dvanderboom.word$p$pss.com/2007/12/11/visual-studio-2008-project-reference-oddness/">article在详细介绍了这个问题。

Here's an article that describes this issue in more detail.

这篇关于.NET参考specificversion真的还是假的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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