1
votes

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.

2
running gacutil -l should ideally show up all assemblies in the GAC. I am not pretty sure that doing a file copy does not install the assembly to GAC, but rather just copies the assemblies to C:\Windows\assembly. May be the application worked, because there was a copy of the required assemblies in the application directory?gmaran23

2 Answers

1
votes

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

0
votes

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.