views:

50

answers:

3

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 ?

+1  A: 

One of the major differences is that you can compile assembly policies and store them in the GAC so that fusion will be able to find an appropriate assembly if several versions of the same assembly are available

vc 74
Right, this can be one of, but let say we dont want to keep in Gac AND PLACE ASSEMBLIES IN SHARE FOLDER, then what is wrong there? all connected development machines can access my assemblies over the LAN and can use in there programes. what is impact is places assemlies in shared dir rather than keep those in GAC , basically ?
Lalit
+2  A: 

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

tecnocrata
+1  A: 

Assemblies in the GAC run with Full Trust. Assemblies anywhere in any file system fall under some Security Guidelines that may prevent them from functioning. For example, before .net 3.5 SP1, assemblies on a Network share were untrusted and couldn't do stuff like accessing the file system.

Michael Stum