Why does GACUtil claim to install the assembly in the GAC, but doesn’t really work?

I have an assembly: SomeAssembly.dll

I have a GACUtil folder in my path: C: \ Program Files (x86) \ Microsoft SDK \ Windows \ v7.0A \ Bin \ NETFX 4.0 Tools

I go to the SomeAssembly.dll folder, execute

GACUtil /i SomeAssembly.dll 

Answer:

 Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. Assembly successfully added to the cache 

I check C: \ Windows \ Assembly , but my assembly does not exist.

I return to my command window (which, as I note, the Administrator has) and type:

 GACUtil /l SomeAssembly.dll 

and the answer confirms ...

 Microsoft (R) .NET Global Assembly Cache Utility. Version 4.0.30319.1 Copyright (c) Microsoft Corporation. All rights reserved. The Global Assembly Cache contains the following assemblies: Number of items = 0 

So it seems SomeAssembly.dll is missing from the GAC

Why?

+4
source share
1 answer

Leave the .dll extension when using gacutil /l and it should correctly report your build.

In addition, I suspect that some 32/64-bit mixing may occur. When you browse C:\Windows\Assembly through Windows Explorer, you most likely see only a 32-bit GAC.

[ UPDATE: looks like this: .NET 4 stores GAC assemblies in C:\Windows\Microsoft.NET\assembly , so you only see CLR v2.0 assemblies in C:\Windows\Assembly .]

To view the actual contents of the GAC directory (V2 CLR), view it without explorer extension - a quick way to do this is to map the drive to the directory using subst and browse through it, for example

 C:\>subst G: c:\Windows\assembly C:\>start G: 
+8
source

All Articles