Copying a DLL from the GAC

I’m a little paranoid about upgrading DLLs in the GAC. Specifically, I want the existing version in case the version I am about to update goes horribly wrong. Upgrades gone wrong has probably never happened to you, but it has for me, and I want to be sure I can roll back a GAC update if the sad clown of life strikes. So when I needed to update the latest version of DukesOfHazzard.dll, I wanted to create a backup.

The GAC is in the C:\Windows\Assembly folder. If you navigate to that folder, you can’t just copy the file somewhere else. I’ve read on Stack Overflow about a modification to Windows Explorer, but frankly, I didn’t want to jump through hoops just to copy a file. So instead of jumping through those hoops, I jumped through different ones.

To copy a DLL from the GAC to another folder:

1) Open a command prompt.
2) Go to the c:\windows\assembly\GAC_MSIL folder.
3) Move into the directory of the DLL that needs to be changed. In my case, “cd DukesOfHazzard”.
5) Inside of the DukesOfHazzard folder is another folder with a wonderfully obtuse name, like 1.0gac.0.0__56da0244276eb35e. Move into that directory: “cd 1.0gac.0.0__56da0244276eb35e”.
5) Success! You have reached the folder where you DLL actually resides. Copy it to whatever awesome directory you want: “copy DukesOfHazzard.dll c:\ScottRocks”. It IS required to have a directory called ScottRocks, in case you were wondering.

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: