0

长话短说,我是 VisualBasic 6 项目的维护者,该项目生产的 ActiveX COM DLL 被组织内部使用的约 50 个其他软件包在内部使用。

在过去的几年里,我们一直在为每个发布的 DLL 遵循语义版本控制“MAJOR.MINOR.PATCH”,并为每个发布分配一个唯一的 GUID。即 1.1.1 和 1.1.2 有单独的 GUID。

它工作正常,但这会导致每个软件包都需要一个新版本——即使不需要任何软件包——只是为了它们可以引用新的 GUID 并重新编译。由于发布的内部流程,这浪费了几十个工时。

我的问题是,为每个 MINOR 版本维护一个 GUID 以使 1.1.1、1.1.2 甚至 1.1.99 都具有相同的 GUID 是否是一种“不好的做法”?每个主要版本都做一个 GUID 会更好吗?

这将导致仅在制作新的主要或次要版本时才更改引用,从而减少依赖于它的软件包所需的更改数量。

最后,如果它有助于响应,当前 DLL 被命名为:MyActiveXDLL_vMAJOR.MINOR.PATCH.dll。

使用每个 MINOR 的 GUID,我们将切换到 MyActiveXDLL_vMAJOR.MINOR.dll

4

1 回答 1

0

It is possible to do this by not changing the GUID (you can set it in Class Builder, and it is stored in hidden attributes you can see if you open the source file in Notepad), but you can only do this if you aren't making any breaking changes.

Breaking changes are:

  • Interface changes (added/changed/removed/re-ordered methods/properties)
    • Includes changes to dispids, parameter orders, parameter names
  • Removed interfaces
  • Methods which worked before but don't now. (only a problem if the method is used. If no longer used, you can deprecate it and just have it throw an error, but not get rid of it).

In VB by default you will be relying on the auto-generated dispids, guids and interfaces. You can set these to particular values using the Class Builder.

You can set the initial values to the auto-generated values in the previous release. You have to do this by hand - you will have to open the type library in TLBVIEW to find out what they are.

于 2014-09-24T16:07:01.123 回答