GAC 和程序集版本控制

发布于 2024-08-14 12:14:27 字数 1076 浏览 2 评论 0原文

我必须向 GAC 部署一些程序集。我只是对(我的)对 GAC 的理解有一些疑问。真的让我很困惑。

我想知道要更改程序集和文件版本的版本。通过安装应用程序来替换 GAC dll 的可能组合有哪些。以及GAC文件的基本管理。

我将使用以下示例解释我的问题,以便更好地理解 GAC:

假设我有产品 A 和 B。

A 和 B 均引用 GAC 中安装的 myfile.dll。
(i) 程序集版本:[1.0.0.0]
(ii) 程序集文件版本:[2.0.0.0](故意不同以避免更多混淆)

  1. 假设我在 myfile.dll 中应用了错误修复。 那么我应该更改哪个版本?

  2. 假设我有新版本的 A 说“ANEW”。那么应该更改哪个版本,以便 A、B ANEW 都可以并排存在。

  3. 假设我安装了“A”,并且 GAC 中存在 myfile.dll,现在我尝试安装 'B' 具有带有错误修复的 gac dll ..然后要更改哪些版本,以便更改反映在 'A' 中。

  4. 与 Q3 相同,但 B 的更改不应反映在“A”中。

  5. 假设“A”与 myfile(1.0.0.0) 一起安装。现在假设“B”正在安装 myfile(1.xyz).. GAC 文件会被替换吗?

  6. 假设“A”与 myfile(1.0.0.0) 一起安装。现在假设“B”正在安装 myfile(2.xyz).. GAC 文件会被替换吗?

  7. 假设“A”与 myfile (1.0.0.0) 一起安装。现在假设“B”正在安装 myfile(1.0.0.0) 假设版本未更改.. GAC 文件会被替换吗?

  8. 另外,GAC dll 是如何删除的。删除有什么标准吗?

我想问题有点令人困惑,但希望你们知道我在问什么。

PS:与此主题相关net- assembly-dll-sharing-and-deploying

i have to deploy few assembly to GAC. I just had a few questions about (my) understanding of GAC. really confuses me.

I want to know which versions to change assembly and file version. What are possible combinations in which GAC dll will be replaced by installing application. and basic management for GAC files.

I will explain my question using following example for better understanding of GAC :

Suppose i have products A and B .

Both A and B refer to myfile.dll installed in GAC.
(i) assembly version : [1.0.0.0]
(ii) assembly file version : [2.0.0.0] (intentionally different to avoid more confusion)

  1. Suppose i have a bug fix that applied in myfile.dll.
    Then which version should i change?

  2. Suppose i have new version of A say 'ANEW' .then which version should be changed so that
    both A,B ANEW can reside side by side.

  3. suppose if i have 'A' installed with myfile.dll present in GAC and now i try to install
    'B' which has gac dll with bug fixes ..then which versions to change so that change reflects in 'A'.

  4. same as Q3 but B's change should not reflect in 'A'.

  5. Suppose 'A' is installed with myfile(1.0.0.0). Now suppose 'B' is installing with
    myfile(1.x.y.z).. will the GAC file be replaced?

  6. Suppose 'A' is installed with myfile(1.0.0.0). Now suppose 'B' is installing with
    myfile(2.x.y.z).. will the GAC file be replaced?

  7. Suppose 'A' is installed with myfile (1.0.0.0). Now suppose 'B' is installing with
    myfile(1.0.0.0) assuming the version is not changed.. will the GAC file be replaced?

  8. Also how are GAC dlls removed .is there any criteria for removal?

I guess questions are bit confusing but hope you guys know what im asking.

PS: Related to this topic net-assembly-dll-sharing-and-deploying

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行至春深 2024-08-21 12:14:27

1)取决于您为了修复错误而进行了什么样的更改。如果您更改任何公共接口或对行为进行重大更改,我会更改程序集版本号。如果没有,您可以像 Microsoft 那样执行该文件的唯一版本。

2) GAC 只关心程序集版本。因此,如果您希望两个名称相同的程序集并排存在,则它们必须因程序集版本而异。

3)我可能会更改程序集版本号,并包括发布者策略以将旧版本的客户端重定向到新版本。

4) 与 3 相同,但不包含发布者策略,或配置 A 绕过它。

5)& 6) 不,它是并排安装的。

7)我不这么认为,但这可能取决于它们的文件版本是否不同。我相信你可以尝试一下来验证一下。

8) 有一些参考资料可用于防止意外删除。 MSI 使用它,因此如果您使用 MSI 进行安装,它会跟踪对程序集的引用,并且在卸载所有应用程序之前不会将其删除。如果您手动执行此操作(例如使用 Gacutil /uf),则可能会搞砸。

1) Depends on what kind of changes you make to fix the bug. If you change any public interfaces or make significant changes to behaviour, I'd bump the assembly version number. If not, you can do what Microsoft does an only version the file.

2) Assembly version is all that the GAC cares about. So if you want two identically named assemblies to live side by side, they have to differ by assembly version.

3) I would likely change the assembly version number, and include publisher policy to redirect clients of the old version to the new.

4) Same as 3 but don't include publisher policy, or configure A to bypass it.

5) & 6) No, it's installed side by side.

7) I don't think so, but it may depend on if they differ in file version. I'm sure you can try it to verify.

8) There are references that may be used to prevent accidental removal. MSI uses that, so if you use MSI for installing, it keeps track of references to the assembly and doesn't remove it until all apps are uninstalled. If you do it manually (say using Gacutil /uf) you can screw things up.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文