程序集是否可以安装在 GAC 中但不显示在 Gacutil.exe 中?

发布于 2024-08-27 13:12:13 字数 284 浏览 4 评论 0原文

我有一个应用程序,其中一些程序集在部署时被复制到 C:\Windows\Assembly,假设这会将它们安装在 GAC 中。该应用程序似乎可以工作,但是当我在复制的程序集上运行 gacutil.exe 时,它​​说全局程序集缓存包含 0 个程序集。

c:\Windows\Assembly 中的所有程序集是否都应该显示在 gacutil 中?如果没有,为什么不呢?如何验证该程序集是否确实安装在 GAC 中?

我过去一直使用 gacutil.exe 来注册程序集,因此进行文件复制对我来说是新鲜事,我正在尝试了解其后果。

I've got an application where some assemblies are copied to C:\Windows\assembly upon deployment under the assumption that this installs them in the GAC. The application seems to work but when I run gacutil.exe on the copied assemblies, it says the Global Assembly Cache contains 0 assemblies.

Should all assemblies in c:\Windows\assembly show up in gacutil? If not, why not? How can I verify that the assembly is in fact installed in the GAC?

I have always used gacutil.exe in the past to register assemblies so doing a file copy is new to me and I'm trying to understand the ramifications.

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

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

发布评论

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

评论(2

傲鸠 2024-09-03 13:12:13

令人惊讶的是,是的,但这会滥用 GAC 的内部运作方式,所以不要这样做。

Surprisingly yes, but this would be an abuse of the internals of how the GAC works so don't do that.

挽袖吟 2024-09-03 13:12:13

是的。
可以通过添加相应的注册表键来在系统中注册程序集。

同时,程序集不一定位于 GAC 文件夹中。
gacutil 会显示放置在 GAC 文件夹中的程序集文件。

这就是为什么建议仅当程序集在系统中注册时才部署到 GAC。

Yes.
The assembly can be registered in the system by adding respective REGISTRY KEYS.

Also at the same time, the assemblies need not be necessarily in the GAC folder.
And gacutil reveals the assembly files placed in the GAC folder.

That is why it is recommended to deploy to GAC only if the assembly is registered in the system.

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