为什么框架 dll 在多个地方重复?

发布于 2024-09-02 01:38:09 字数 419 浏览 1 评论 0原文

安装.Net 4并得到一些已经在此处解答的问题后,我还意识到框架dll是如何在多个地方重复的不同的 Framework 版本(这不是新问题,以前的版本也会出现这种情况,但直到现在才注意到)

1 - GAC:%systemroot%\ a​​ssembly

2- Framework 安装目录:%systemroot%\Microsoft.NET\Framework \v...

3-如果您安装了 Windows SDK,也在:C:\Program Files\Microsoft SDKs\Windows\

我认为最后一个是所谓的“参考组件”,并且有额外的元数据来帮助视觉工作室,但是

2 号位置呢?为什么在那里重复集会?

After installing .Net 4 and getting some questions that were already answered here I also realized how the Framework dlls are repeated in several places for the different Framework versions (this is not new, it happens with previous versions, but hadn't paid attention to it until now)

1 - GAC: %systemroot%\assembly

2- Framework installation directory: %systemroot%\Microsoft.NET\Framework\v...

3- and if you have the Windows SDK installed, also in: C:\Program Files\Microsoft SDKs\Windows\

I think the last ones are the so called "Reference Assemblies" and have extra metadata to aid Visual Studio, but

what about location number 2? Why are assemblies repeated there?

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

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

发布评论

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

评论(2

找回味觉 2024-09-09 01:38:09
  1. 不,这是 .NET 1.x 到 3.5 的 GAC 位置。 4.0 的 GAC 位于 c:\windows\microsoft.net\ assembly 中。为什么要移动它还不清楚,可能是为了避免直接从 GAC 引用程序集的项目出现麻烦,这是一个很大的禁忌,但它已经完成了。

  2. 是的,参考程序集就在那里。也在 c:\program files\reference assembly 中。它们最初是存储在 GAC 中的程序集的逐字副本。直到您部署某种修补程序。将它们分开可以确保您构建的程序以“正确的”框架程序集为目标,而不是您碰巧存储在 GAC 中的程序集。

  3. 是的,没有框架程序集,只有构建工具。

  1. No, that's the GAC location for .NET 1.x through 3.5. The GAC for 4.0 is located in c:\windows\microsoft.net\assembly. Why it was moved isn't clear, probably to avoid trouble with projects that referenced assemblies directly from the GAC, a big no-no but it has been done.

  2. Yes, reference assemblies live there. Also in c:\program files\reference assemblies. They are initially verbatim copies of the assemblies stored in the GAC. Until you deploy some kind of hotfix. Keeping them separate ensures that you build programs that target the "proper" framework assemblies, not what you happen to have stored in your GAC.

  3. Yes, no framework assemblies are there, just build tools.

不奢求什么 2024-09-09 01:38:09

这更多的是有根据的猜测,而不是实际的答案,但是......

为了最初 GAC 一个 DLL,您需要有一个完整的 DLL(也称为非引用程序集)供 GAC 使用。参考程序集将无法工作,因为它没有可执行代码。因此,您需要一个真正的 DLL 来获取 GAC,这样您就可以得到位置 #2。

This is more of an educated guess than an actual answer but ...

In order to initially GAC a DLL you need to have a full DLL (aka not-reference assembly) for the GAC to use. The reference assembly won't work as it doesn't have executable code. Hence you need a real DLL in which to source the GAC so you get location #2.

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