Partager via


How to take out the dlls from GAC ?

Once I had a need to see the contents of an out-of-the-box SharePoint assembly (which was installed in GAC) using .NET Reflector tool. Assembly was: Microsoft.SharePoint.AdministrationOperation. Unfortunately we can’t locate this assembly in the physical file system of my SharePoint server. The only way would be take this assembly from outside the GAC – but how?

clip_image002

Since, the default view of the GAC folder is read-only I can’t copy it from there directly. Then, what I did was, opened the GAC in command prompt.

Here we can see the real anatomy of GAC folder.

clip_image004

 And if we want to take that assembly, we have to go inside GAC_MSIL and the version number folder, which will be like below.

clip_image006

And then we can copy this assembly to other file location. (here I am copying it to C:\ drive)

clip_image008

That was the way I did it, but if we want to see the folder-wise structure of GAC, we can do it through by adding a registry entry. You can simply go to, HKLM\Software\Microsoft\Fusion and create a DWORD value named "DisableCacheViewer" and set it to value 1.

After that, open another instance of windows explorer, explore to c:\windows\assembly now and you see magic there. If you set the value of that DWORD value to 0 then you can switch back to the read-only view.

Please see the below screen shot to know how it will look like.

clip_image010

Comments

  • Anonymous
    August 13, 2008
    PingBack from http://hoursfunnywallpaper.cn/?p=1372

  • Anonymous
    October 14, 2008
    Hey Buddy, instead of modifying the registry you can use the following command from the cmd prmpt: SUBST G: C:WindowsAssembly and map the GAC to G: drive and then open any assembly using the .Net Reflector. Regards

  • Anonymous
    October 15, 2008
    Thanks Ketan. Also we can retrieve the GAC dlls using the UNC path like this. \MachineNamec$WINDOWSassemblyGAC_MSIL I think this is the most easiest way. So now we have 3 ways of getting the dlls from GAC :)

  • Anonymous
    October 15, 2008
    The comment has been removed

  • Anonymous
    December 03, 2010
    perfect ...good ways to get the assembly from GAC. Thanks