Posted by: R Manimaran | August 5, 2008

Get a copy of dll in GAC (or) add Reference to a dll in GAC

Sometimes in .net application we need to have a copy of a dll which is available in GAC. But when we view the GAC through C:\Windows\assembly folder or Runà assembly it will show like this

Using this we cannot copy the dll. Only uninstall option is available.

To view the available dll using the naked eye follow the steps

Dot net have a dll file Shfusion.dll which is a Assembly Cache Viewer. It is located in the following path.

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

  1. uninstall the dll using the following command in the run dialog box.

regsvr32 -u C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll

  1. Now type assembly in the Run dialog box.
  2. Now you will see the folder view of the GAC. copy the dll you want.

Note:

To get back to the previous state of view register the Shfusion dll using the following command

regsvr32 C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\shfusion.dll


Responses

  1. That’s really cool. Thanks, this informration was helpful to me.

  2. It will be much easier to use the SUBST DOS Command (http://en.wikipedia.org/wiki/Subst).
    As an example, use “subst x: C:\Windows\assembly”.

  3. Thanks for the info in this article. Adriaan, your tip was helpful too. But the SUBST would not have worked for me, because I needed to add a reference to a DLL in the GAC and I needed to use the “original” path so it would work when I deploy the program to another computer. But still, that was a very cool command. Thanks!

  4. thanks. this small tip totally saved me 3+ hours. :)

  5. very help full topic yar.

  6. well yar.

  7. very helpful, thank you!

  8. Got a question. As soon as the GAC is converted into folder structure only those assemblies having empty Processor Architecture show up. Those having values such as AMD64, MSIL do not get listed. Where can I find those missing assemblies?

    Thank you in advance for your assistance.

    Nirav

    • Hi Nirav,
      I have checked. After i un-install the Shfusion dll, i got the MSIL processor architecture assemblies too. It is in the separate folder. For me it came under GAC_MSIL folder. This folder is located under the root folder of the assembly.
      Check it.

  9. [...] by ken zheng on May 14, 2009 Today I found this blog to show you how to get dll from GAC you can run Dot net have a dll file Shfusion.dll which is a [...]

  10. Great job!!!

  11. Awesome man.

  12. Thanks Buddy , it works.

  13. Sounds good, but the list still showed assemblies after unregistering. I am using Windows Vista, if that matters.

  14. Thanks….helps me a lot


Leave a response

Your response:

Categories