GAC 32bit vs. 64bit

Jerad Rose picture Jerad Rose · Jun 28, 2011 · Viewed 40.6k times · Source

I've been searching for a while trying to understand this better, but am not finding any straight-forward answers on this.

I have a component that I need to add to the GAC. I'm running Windows 7 64-bit, and in an effort to troubleshoot an issue (SSIS 2005 isn't recognizing the DLL), I'm trying to make sure I have the DLL (.NET 4.0) registered in the proper GAC.

So here are my questions:

  1. Where are the physical locations in Windows 7 for both 64bit and 32bit GACs? I know of C:\Windows\assembly, but not sure which one this is, and where the other one is.

  2. Which version of gacutil do I use to add an assembly to 64bit GAC? 32bit GAC? I know of C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC, and I'm assuming this is for 32bit, but not sure where 64bit gacutil is.

  3. What determines which GAC an application looks in for the assembly? I'm assuming this is determined by whether the app is 64bit or 32bit, but am wondering if there is more to it than that.

Thanks in advance.

Update:

After digging into this following ShaneBlake's answer, I remembered that .NET 2.0 and .NET 4.0 GACs are in different locations. So:

.NET 2.0 GAC:
c:\windows\assembly (32bit and 64bit?)

.NET 4.0 GAC
c:\windows\Microsoft.NET\assembly\GAC_32 (32bit only)
c:\windows\Microsoft.NET\assembly\GAC_64 (64bit only)
c:\windows\Microsoft.NET\assembly\GAC_MSIL (32bit & 64bit?)

Answer

ShaneBlake picture ShaneBlake · Jun 28, 2011

The gacutil.exe should install the .dll to the right location depending on how it was compiled. You should be able to find the file here : %ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\

.NET 4 has it's own Assembly folder (c:\windows\Microsoft.NET\assembly) which has a \GAC_32 and \GAC_64 directories within... This is where you will find your files once they're installed.

Hope that helps...