<< Back To All Blogs
Copy a DLL from the GAC
Tuesday, February 10th, 2009
I was doing some command-line building today and needed a DLL that was distributed in an SDK that I had not yet installed, and didn't know specifically what SDK I needed to install. Instead of installing a whole bunch of SDKs, I decided I would copy the DLL from a machine I already knew had the DLL. The problem that I ran into was that the DLL was in the machine's GAC. I then realized that this has happened to me a few times before, so I thought I would share how you can copy a DLL directly from the GAC of another machine.
A small disclaimer: Be careful while doing so as you could accidentally replace files that are specific to an architecture or version of your operating system. Do this at your own risk. Specifically be careful with versions between 32 and 64 bit operating systems.
The process is very simple:
Open a command prompt and navigate to C:WindowsAssembly
Everything inside the GAC is treated as the same file/folder structure of windows.
There are normally a few folders in here, and you may have to do some dir'ing to find out which one contains your DLL, but once you have done so cd to that directory. In my case, just C:WindowsAssemblyGac.
Do a cd to your DLL name, for instance cd System.Windows.Forms.dll.
There will be another folder within this folder with versioning, cd to that Directory.
From this directory use the copy command, ie, copy System.Windows.Forms.dll C: to copy to the local C:, or whichever other path you would like.
Hopefully that helps!
GACin' Tom Out.
Determining if a computer is a laptop or desktop in C#
SharePoint RPC: Corrupted Binary Files
Awesome .NET 4: Named and Optional Parameters for Classes and Methods
Reading a Microsoft Project file (mpp) in C#
Currently no comments.
Add A Comment
Email Address: (not public, used to send notifications on further comments)
Enter the text above, except for the 1st and last character: