RSS

Taking backup of an assembly from GAC folder

13 Sep
Sometimes we would have deployed the assemblies to GAC folder and forgot to keep a back up of them for some later reference or history. And after sometimes you are coming with another (also could be new version) update of the same assembly and want to deploy to GAC and remembered that you forgot to keep the back up of earlier assembly version. Now you should have the earlier GAC assembly’s backup copy. As there is no direct copy/paste mechanism to do it from GAC, Microsoft has given an option of doing it indirectly or through registry. But before playing with registry you might need to keep a backup of registry state as in case if anything goes wrong in registry, while playing with it:
 
– Under HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\FUSION\ reg hive create an REG_DWORD key entry with name "DisableCacheViewer" and set it’s value to 1 (as shown in below image).
 
 
– After setting the registry value to 1 , go to GAC folder (C:\Windows\Assembly) and you would see the folder structures as shown in the below image instead of normal GAC structure.
 
 
– Then go to the GAC_MSIL folder and copy your required assembly as normal windows copy/paste. This would be your back up.
 
– Once you are done with the backup process, don’t forget to reset the registry entry to it’s earlier state(GAC’s viewing structure also)
 
– Set the "DisableCacheViewer" entry value to 0 (zero). as shown in the below image.
 
 
– After the above step the GAC folder goes back to the normal state of look and feel as shown in the below image.
 

 
 
 
 

Leave a comment