title: Referencing the Global Assembly Cache
body: <p>I have a project which needs to use NHibernate to communicate with my Oracle database.</p>
  
  <p>Many projects at my workplace use NHibernate, so the NHibernate assembly was placed in the Global Assembly Cache, a tool that I do not entirely understand. From my research, I have gathered the following:</p>
  
  <ol>
  <li>The <a href="http://en.wikipedia.org/wiki/Global_assembly_cache" rel="nofollow noreferrer">Global Assembly Cache</a> is a central repository for dlls which are referenced by many projects. This dodges the problem of DLL Hell - when a new version of your dll is released, you update it in the cache a single time, and all .NET projects that reference it will now use the new version.</li>
  <li>You cannot add a reference to an assembly in the assembly cache. "<a href="http://www.platinumbay.com/blogs/dotneticated/archive/2008/09/02/add-reference-and-the-gac.aspx" rel="nofollow noreferrer">Assemblies that have been registered in the GAC will not appear in [the Add Reference] list</a>". You can, however,  forcibly make them appear by mutilating the registry.</li>
  <li>You can easily add a reference to an assembly in the assembly cache. "<a href="https://stackoverflow.com/questions/3386142/using-global-assembly-cache-gac-in-the-way-it-was-designed-to/3386296#3386296">simply use the Add Reference window to add a reference to an assembly you've installed in the GAC</a>". (I'm inclined not to believe this, since I don't see any GAC assemblies in my Add Reference window).</li>
  <li>Several projects at my workplace do have references to many assemblies in the GAC. Those assemblies never appear in the "Add Reference" menu, so I know my predecessors did not use the registry mangling technique. Yet they clearly originate from the GAC - their file path is a subdirectory of C:\Windows\assembly.</li>
  </ol>
  
  <p>Point two obviously contradicts the other three, but if it were simply false, I wouldn't have any problems referencing libraries. It definitely reflects reality in that my GAC assemblies are nowhere to be found in the "Add References" window. </p>
  
  <p>I would like to know two things:</p>
  
  <ul>
  <li>When would a developer ever want to use the GAC? What good is a
  library that can't be referenced without registry trickery?</li>
  <li>What steps did my predecessors take to reference libraries in the
  GAC, without touching the registry?</li>
  </ul>