assembliesglobal-assembly-cache

Confusion about GAC


While the interview , I was confused after interviewer asked this question about Global Assembly Cache (GAC). What should be the answer?

Question 1: Instead of keeping the assembly in GAC, If we create the directory and keep our assemblies there and if we make that directory as shared so can the connected computers can use those assemblies? What is the difference if I kept assembly in GAC and in shared folder ?

Edited: Question 2: Consider there is the 4 visual studio enabled development machines. out of those , one is serve as server. so can other machines (other than server machines) use assemblies in the GAC of server machine ?


Solution

  • The assemblies that are hosted in the GAC, are formally called Shared Assemblies or Global Assemblies (please don't confuse with your Shared Assemblies). One advantage of placing an assembly in the GAC is version control, while the assembly is in the GAC, can co-exist with another version of the same assembly, although have the same file name, it is distinguished by the internal signature, which contains a strong name. Please see this link