How to retrieve a DLL from the GAC

Sometime we have some question that we don’t get the answer right away. This one was one of them. I often ask myself “How to get a DLL from the GAC?”, and i didn’t really search for the answer because i was able to retrieve the DLL from another location.

Recently, i had the same question once again but i wasn’t able to find the assembly anywhere else. So i finally got the answer from my college Dominic Sévigny. The trick it’s that we cannot export a DLL from the GAC from the Windows interface. So we need to do it from the DOS console. Here is the procedure to do it:

First you need to open a new command window. You need to browse to the GAC_MSIL folder (c:\Windows\assembly\GAC_MSIL)

image

Each assembly have it own folder. So if you need to access the assembly “CrystalDecisions.ReportAppServer.ClientDoc” you can do it by accessing the folder.

C:\Windows\assembly\GAC_MSIL>cd CrystalDecisions.ReportAppServer.ClientDoc

Once in the folder, you should see a subfolder for each version of the assembly in the GAC.

C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc>dir
Volume in drive C has no label.
Volume Serial Number is C470-AE11

Directory of C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc

23/04/2009  09:55 PM    <DIR>          .
23/04/2009  09:55 PM    <DIR>          ..
23/04/2009  09:55 PM    <DIR>          10.5.3700.0__692fbea5521e1304
               0 File(s)              0 bytes
               3 Dir(s)  38,585,462,784 bytes free

Select the version you need by accessing the folder.

C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc>cd 10.5.3700.0__692fbea5521e1304

C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc\
10.5.3700.0__692fbea5521e1304>dir
Volume in drive C has no label.
Volume Serial Number is C470-AE11

Directory of C:\Windows\assembly\GAC_MSIL\CrystalDecisions.ReportAppServer.ClientDoc\
10.5.3700.0__692fbea5521e1304

23/04/2009  09:55 PM    <DIR>          .
23/04/2009  09:55 PM    <DIR>          ..
23/04/2009  09:55 PM            57,344 CrystalDecisions.ReportAppServer.ClientDoc.dll
               1 File(s)         57,344 bytes
               2 Dir(s)  38,585,479,168 bytes free

 

Now you have access to the DLL of the assembly you need. So you can copy the DLL, using Copy or XCopy, to the location you want 

image

This is why i love my job i always learn new stuff everyday, even it’s something very simple!!

Regards,
Louis-Philippe

DotNetShoutout
DotnetKicks

Comments (4) -

anirudhya sanyal
anirudhya sanyal
6/9/2010 12:45:55 PM #

very very helpful

LeeNgocHai
LeeNgocHai
10/27/2010 2:25:15 PM #

thanks so much, grateful

Windows 7 Key
Windows 7 Key
6/16/2011 10:52:38 AM #

Very very helpful article content. Thank you for sharing the article . It let me know something I didn`t know .You write well, I have bookmarked, I will wander back.

Monalisa Smith
Monalisa Smith
10/19/2011 5:42:40 PM #

Nice information.....thanks

Pingbacks and trackbacks (1)+

Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading

About the author

Louis-Philippe Pinsonneault is a senior .NET developer and trainer at Runatserver. He has over 10 years of experience with . NET technology. He is a certified Microsoft Certified Professional Developer (MCPD) and a Microsoft Certified Technology Specialist .NET Framework 3.5 ASP.NET Application. He also teaches ASP.NET at Technologia, Montréal. He was awarded an MVP for Device Application Developement in 2010 and 2011.

Microsoft Most Valuable Professional

Microsoft Certified Professional Developer

Microsoft Certified Technology Specialist

View Louis-Philippe's profile on LinkedIn

Page List

Month List