最佳实践进行组装的命名和版本? [英] Best practices for assembly naming and versioning?

查看:128
本文介绍了最佳实践进行组装的命名和版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找了一些好的做法命名集会和版本他们。你多久增加主要或次要版本?

I am looking out for some good practices on naming assemblies and versioning them. How often do you increment the major or minor versions?

在一些情况下,我看到释放直行从版本1.0到3.0。在其他情况下,它似乎是停留在版本1.0.2.xxxx

In some cases, I have seen releases going straight from version 1.0 to 3.0. In other cases, it seems to be stuck at version 1.0.2.xxxx.

这将是在整个公司多个项目中使用的共享组件。展望一些好的投入。

This will be for a shared assembly used in multiple projects across the company. Looking forward to some good inputs.

推荐答案

从的在苏珊库克的博客这篇文章 MSDN上(转贴2003-05-30):

Some good information from this article on Suzanne Cook's blog on MSDN (posted 2003-05-30):

首先,文件版本和装配版本不需要一致   与彼此。我建议的文件版本,每一个变化   建立。但是,不改变组件版本,每个版本只是让   你可以告诉两个版本相差无几   文件;使用文件版本为该。决定何时改变装配   版本需要的类型的一些讨论的建立需要考虑:   航运及非航运。

When to Change File/Assembly Versions

First of all, file versions and assembly versions need not coincide with each other. I recommend that file versions change with each build. But, don’t change assembly versions with each build just so that you can tell the difference between two versions of the same file; use the file version for that. Deciding when to change assembly versions takes some discussion of the types of builds to consider: shipping and non-shipping.

非航运构建
一般情况下,我建议保持非航运集版本之间的航运构建相同。本   避免强名称组件加载问题,是由于版本   错配。有些人preFER使用发行政策重定向新   集版本为每个制作。我建议对,对   然而,非船建造,它并不能避免所有的负载   问题。例如,如果一个合作伙伴的X拷贝你的应用程序,他们可能不会   知道要安装出版商策略。然后,您的应用程序将用于被打破   他们,即使它只是罚款你的机器上。

Non-Shipping Builds
In general, I recommend keeping non-shipping assembly versions the same between shipping builds. This avoids strongly-named assembly loading problems due to version mismatches. Some people prefer using publisher policy to redirect new assembly versions for each build. I recommend against that for non-shipping builds, however: it doesn’t avoid all of the loading problems. For example, if a partner x-copies your app, they may not know to install publisher policy. Then, your app will be broken for them, even though it works just fine on your machine.

但是,如果存在这样的情况在相同的不同应用   机器需要绑定到不同版本的组件,我   推荐给那些建立不同的装配版本,使得   可以不必使用用于正确一个用于每个应用程序的   LoadFrom /等。

But, if there are cases where different applications on the same machine need to bind to different versions of your assembly, I recommend giving those builds different assembly versions so that the correct one for each app can be used without having to use LoadFrom/etc.

送货构建
至于它是否是一个好主意,改变版本航运构建,这取决于你如何希望绑定   对最终用户的工作。你想这些构建是并排侧或   到位?介于两个版本有很多变化?他们是   要打破一些客户?你关心它打破他们(或者做   要强制用户使用您的重要更新)?如果是的话,你   应该考虑递增程序集版本。不过,话又说回来,   认为这样做太多次可以产仔用户的磁盘   过时的组件。

Shipping Builds
As for whether it’s a good idea to change that version for shipping builds, it depends on how you want the binding to work for end-users. Do you want these builds to be side-by-side or in-place? Are there many changes between the two builds? Are they going to break some customers? Do you care that it breaks them (or do you want to force users to use your important updates)? If yes, you should consider incrementing the assembly version. But, then again, consider that doing that too many times can litter the user’s disk with outdated assemblies.

当你改变你的程序集版本
要改变很难codeD版本,以新的,我推荐一个变量设置为版本   在头文件和替换硬编码与源   变量。然后,在生成过程中运行pre处理器将在   正确的版本。我建议改变航运版本之后,   不正确的之前,因此有更多的时间赶上因错误   改变。

When You Change Your Assembly Versions
To change hardcoded versions to the new one, I recommend setting a variable to the version in a header file and replacing the hardcoding in sources with the variable. Then, run a pre-processor during the build to put in the correct version. I recommend changing versions right after shipping, not right before, so that there's more time to catch bugs due to the change.

这篇关于最佳实践进行组装的命名和版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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