How To Install .NET Assembly Into GAC

A situation arose the other day where we needed to install DLL’s directly into the GAC, and the thing is locked down tighter than … well, insert your best dirty joke here.  Needless to say, where there’s a will, there’s a way.  I will make the disclaimer right now, you should never ever do this!  Since you’re probably wanting to do it now, here’s how to do it.

There’s a (non-obvious) way of doing this using the traditional drag and drop method:

  1. Open a Command Prompt as Administrator (right click, Run As Administrator).
  2. Run the command "explorer C:windowsassembly".
  3. Open a new explorer window from the window which just opened (Right click -> Open whilst holding Ctrl). I did this by hopping back up to C:windows and the navigating to my assembly in the second (new) window.
  4. Navigate in the first windows back to C:windowsassembly.
  5. Drag and drop between the two windows.

Again, never do this.  Let me know if this works for you.  Never ever do it.  🙂

This comes from the following MSDN post: http://social.msdn.microsoft.com/Forums/en-US/netfxsetup/thread/1c3ab849-84a0-4eb7-8c3b-b01fbca825a3/

Tag: NOT Best Practices