NerdyHearn
Home
Blog

Contact
Mailing List

Software

Active Directory Products
Object Compare
Permission Compare

IPhone Products
Calls To Calendar
SMS To CSV
SMS To Gmail
Voicemail To Gmail

Sites
DocuTerminal
How Long For Me
My Music To Me
SaveMySerials
TypeCount

Blog
Twitter

NerdyHearn - Blog


<< 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.

Tags

CSharp

Related Blogs


Comparing XML files in C# Using Microsoft's Diff and Patch Tool
Enumerating the values of an enum in C#
Bitmasking userAccountControl attribute in LDAP from C#
Reading an XML file using LINQ

Comments

Currently no comments.

Add A Comment

Name:


URL:


Email Address: (not public, used to send notifications on further comments)


Comments:



Enter the text above, except for the 1st and last character:


NerdyHearn - Latest tech news relating to C#, ASP.NET, SharePoint, PHP, general development, and more. DocuTerminal - Online Filing Cabinet solution. Scan, search and archive your paper documents. SaveMySerials - Protect yourself from theft, fire, natural disasters and more by recording your serial numbers My Music To Me - Stream your subsonic music collection to your Sonos wireless system TypeCount - Count how often you type across different computers! ServrTrackr - Monitor your SSL certificates, website uptime, and DNS configurations