更新 GAC 中的 DLL [英] Updating a DLL in the GAC

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

问题描述

我有多个第三方应用程序引用的 API DLL.

I have an API DLL that several third party applications reference.

其中一些应用程序在更新方面需要两种方式.1) 我想要最新的东西2) 不要经常更新我的直接二进制文件

Some of these applications want things two ways in terms of updates. 1) I want the latest stuff 2) Don't update my direct binaries that often

曾考虑将 DLL 移动到 GAC 并编写另一个 DLL,该 DLL 只是 GAC 中 DLL 的包装器(然后第 3 方应用程序将引用它).这允许在 GAC 中更新业务逻辑(经常更改的部分),并且包装 DLL 仅需要在新函数可用时更新.

There has been the thought of moving the DLL into the GAC and writing another DLL that is simply the wrapper for the DLL in the GAC (which the 3rd party apps would then reference). This allows the business logic (the part that would change frequently) to be updated in the GAC and the wrapper DLL would only need to be updated when new functions were made available.

GAC 旨在保留版本化的 DLL.因此,包装 DLL 将引用特定版本的 API DLL.更新 GAC DLL 以使其引用不会中断但二进制内容不同有多难?

The GAC is intended to keep versioned DLLs. So the wrapper DLL would have a reference to a specific version of the API DLL. How difficult is it to update the GAC DLL so that the references to it don't break but the binary contents differs?

这是否像更新时不更改 GAC DLL 版本一样简单?

Is this as simple as not changing GAC DLL versions when updating?

谢谢.

推荐答案

您可以创建更新的程序集,对其进行签名并将其推送到 GAC,以便引用此程序集的应用程序不会注意到差异.您需要指定版本号的所有部分(即在 AasemblyInfo.cs 文件中将版本号设为 1.2.3.4 而不是 1.2.3.*)并使用相同的 sn 键.然后版本特定的参考不会被破坏.您将能够根据需要更新 DLL.

You can create an updated assembly, sign it and push it to the GAC so that the applications, which reference this assembly, won't notice the difference. You need to specify all parts of the version number (i.e. have the version number as 1.2.3.4 and not 1.2.3.* in AasemblyInfo.cs file) and use the same sn key. Then the version-specific reference won't be broken. And you'll be able to update your DLL as you need.

这篇关于更新 GAC 中的 DLL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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