Skip to content


How To Copy DLL files out of GAC (Windows Assembly), Using Explorer Or Command Line

I was struggling with creating a staging server for my companys SharePoint server. It really did not want to do what I wanted.
We had cloned the server, and later on we restored the clone from a backup. The backup didn’t use Volume Shadow Copy (VSS), so the open files were not backed up, making it a pretty useless backup in case of a total breakdown.

On the new server I was missing a lot of DLLs because of this. Oh the joy of having an ex consultant who had set it all up, and didn’t bother to leave copies of the features etc. she had installed. Bottom line, the only place I had the myriad of DLLs now was in GAC. So I had to figure out how to copy files out of there. Getting them there by copying in console was strange enough (gacutil.exe is needed), so I figured this was gonna be hard :)

This is how Windows Assembly normally looks

Standard Assembly view - GAC view

Standard Assembly view - GAC view

Well it’s not really.

Theres 2 ways to do it: Change registry to enable browsing with explorer, and copying them via the console. For some reason via console the folders act just like normally, so that’s easy.

Copy DLL files from GAC using Windows Explorer:

As you have most certainly noticed, the GAC / Assembly is not a normal folder. It’s special :-) . Im sure it’s dont for a pretty good reason, so I will not moan about it just now. Theres good news though; you can change it so it will act just like a normal folder. In order to disable the “special” behavior you get in GAC folder when you use explorer, add an entry to the registry as below.

First start registry edit by writing “regedit” in “Run” or command prompt.

Browse to “HKEY_LOCALMACHINE\Software\Microsoft\Fusion”

Add a Dword called DisableCacheViewer. Set the value of it to 1.

Add Dword key to registry

Add Dword key to registry

Add Dword value

Add Dword value

Next time you browse to c:\windows\assembly you will see normal folders. The actual DLLs are in the subfolders you see. You can now easily copy them out of the GAC.

Modified Assembly / GAC view

Modified Assembly / GAC view

Copy DLL files from GAC using Command Prompt:

The files are ready to be copied right away, but you need to figure out the folder structure, since your only used to the “censored” version in explorer most probably (at least since you googled this blogpost).
c:\windows\assembly\ has several folders in them:

GAC
GAC_32
GAC_MSIL
+ a native… That one is not what I needed at least.

It seems all my .NET assemblies go to the GAC_MSIL, and that makes perfect sense. If you don’t know where your DLL might be, just go through all 3.
12.0.0.0__71e9bce111e9429c

To copy 1 file at a time:

xcopy c:\windows\assembly\gac_msil\Microsoft.SharePoint\12.0.0.0__71e9bce111e9429c\Microsoft.SharePoint.dll c:\GACCopy\
This Assembly is called Microsoft.SharePoint.dll, version 12.0.0.0 culture=neutral and public key token 71e9bce111e9429c.

To copy all DLL files from GAC to a temp folder, just in case you didn’t want to do the registry change:
xcopy c:\windows\assembly\*.* C:\GACCopy\ /s /r

Happy De-GAC’ing

  • Delicious
  • Digg
  • Twitter
  • Facebook
  • LinkedIn
  • TechNet
  • StumbleUpon
  • NewsVine
  • Technorati Favorites
  • Slashdot
  • MSDN
  • Share/Bookmark

Related posts:

  1. Open command prompt for specific folder using Windows Explorer (Command To Here)
  2. Stsadm is not recognized as an internal or external command, operable program or batch file.
  3. stsadm is not recognized as an internal or external command, operable program or batch file.
  4. Stop / deactivate beep in Windows

Posted in Windows.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

Continuing the Discussion

  1. How To Copy DLL files out of GAC, Using Explorer Or Command Line … | Cdcopy new online linked to this post on August 25, 2009

    [...] xcopy in housing or modify gathering to a connatural folder in Explorer. View example here: How To Copy DLL files discover of GAC, Using Explorer Or Command Line … Posted in Sem, Uncategorized | Tags: command, command-line-, console-or-change, either-use, [...]



Some HTML is OK

or, reply to this post via trackback.