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
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.
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.
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
Related posts:




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