GAC的位置在哪里? [英] Where is the location of GAC?

查看:133
本文介绍了GAC的位置在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想更加熟悉.Net全局程序集缓存。网上的各种消息来源说,可以在资源管理器的 C:\WINNT\Assembly 中找到它。但是,我的Windows XP计算机上的 C:下似乎没有 WINNT 文件夹。我已选中显示隐藏的文件和文件夹,并且未选中隐藏受保护的操作系统文件。

I wanted to become more familiar with the .Net Global Assembly Cache. Various sources online say it can be found in Explorer in C:\WINNT\Assembly. But I don't seem to have a WINNT folder under C: on my Windows XP machine. I have "Show Hidden Files and Folders" checked and "Hide Protected Operating System Files" UN-checked.

使用如何检测安装了哪些.NET Framework版本和Service Pack? / a>,尤其是在 http://msdn.microsoft。 com / en-us / kb / kbarticle.aspx?id = 318785 我看到已经安装了.Net 4.0。

Using the methods described in How do I detect what .NET Framework versions and service packs are installed? and especially in http://msdn.microsoft.com/en-us/kb/kbarticle.aspx?id=318785 I see that I have .Net 4.0 installed.

如何可靠地找到它

推荐答案

作为免责声明,我首先要说永远不要直接编辑GAC的内容。

As a disclaimer, I'm going to start by saying that you should never directly edit the contents of your GAC.

继续浏览信息...

您的问题中有两种不同的GAC,分别是2.0 GAC和4.0 GAC。在谈论这些时,他们并不是在指.NET框架的版本,而是所使用的CLR的版本。碰巧的是,在2.0中,CLR为2,在4.0中,CLR为4。作为参考,.Net 3.5的CLR保持为2,因此.net 2.0和.net 3.5的GAC一样。

There are two different GAC's in play in your question, the 2.0 GAC and the 4.0 GAC. When talking about these, they aren't so much referring to the version of the .NET framework, so much as the version of the CLR being used. It just so happens that in 2.0, the CLR is 2, and in 4.0, the CLR is 4. As a frame of reference, the CLR for .Net 3.5 stayed at 2, and hence the GAC for .net 2.0 and .net 3.5 is the same.

但是它在哪里?

2.0 GAC是在资源管理器中的%WINDIR%\Assembly 中。对于大多数较新的Windows操作系统,默认情况下%WINDIR% C:\Windows 。在后台,这实际上是一个外壳扩展,隐藏了GAC的真实位置,但出于您的目的,您打开资源管理器以 C:\Windows\Assembly 进行查看2.0 GAC的内容。 Shell扩展还增加了将程序集拖放到 C:\Windows\Assembly 以便将它们添加到GAC的好处(必须在Win7和

The 2.0 GAC is at %WINDIR%\Assembly in explorer. For most newer Windows OS's, %WINDIR% is C:\Windows by default. Under the hood, this is actually a shell extension hiding the real location of the GAC, but for your purposes, you open explorer to C:\Windows\Assembly to view the contents of the 2.0 GAC. The shell extension also adds the benefit of dragging and dropping assemblies into C:\Windows\Assembly in order to add them to the GAC (UAC must be disabled in Win7 and up.)

4.0 GAC位于 C:\Windows\Microsoft.NET\assembly 。您会在该文件夹下找到各种类型的程序集,这些程序集分为其32位,64位或MSIL子目录。没有CLR4的gac的外壳扩展,因此您正在查看程序集在磁盘上的实际位置。

The 4.0 GAC is at C:\Windows\Microsoft.NET\assembly. You'll find the various types of assemblies divided up into their 32-bit, 64-bit, or MSIL subdirectories under that folder. There is no shell extension for CLR4's gac, so you're looking at the actual place on disk where the assemblies live.

有些偏离主题...

我总是以编程方式检测已安装.Net框架的版本的方式是查看 HKEY_LOCAL_MACHINE\SOFTWARE\ \Microsoft\NET Framework安装\NDP ...子文件夹指示已安装的版本。

The way that I always programmatically detect what versions of the .Net framework are installed is to look at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP ... the sub-folders indicate installed versions.

这篇关于GAC的位置在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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