Click here to Skip to main content
14,022,151 members
Click here to Skip to main content
Add your own
alternative version


22 bookmarked
Posted 6 Jan 2007
Licenced CPOL

Extract GAC Assemblies

, 6 Jan 2007
Rate this:
Please Sign up or sign in to vote.
Extracts .NET assemblies from GAC

Sample Image - Extract_GAC_Assemblies.jpg


Well, today I am going to write a simple but useful utility program that can be used to extract the .NET assemblies from the Global Assembly Cache.


Couple of days ago, I was working with the SharePoint object model and I found that I need to extract some assemblies that are installed in the GAC of my machine. And there was no ready-made tool to do that task. That's why I thought of writing one and posting it here so that next time, it would be easier to do this for me as well as for other developers.

Using the code

I guess most of the readers know the structure of the GAC. But I am explaining it again briefly here. After installation, .NET assemblies remain in the $(windir)\assembly\GAC directory which can be found in the Windows directory (this is the usual scenario). And inside this directory, an assembly is stored under a directory which has a name similar to that of the assembly. Inside this directory there is another directory which is named XXXXX__YYYYY and underneath this directory the actual assembly is stored. Here XXXXX is the version number of the assembly and YYYYY is the public key token. This is because you know that .NET eliminates the "DLLHELL" with its elegant side by side execution. So another assembly that has the same name but a different version can be stored in the GAC without any ambiguity.

Well, inside the code I am just exploring the $(windir)\assembly\ directory programmatically. You cannot explore this directory using Windows explorer. The only way to see the real content of this directory is by using the command shell.

There is nothing more to say here. The code is pretty simple. It simply explores that directory and provides some functionality to extract/install one or more assemblies from/to the Global Assembly Cache.


I hope you will enjoy this!


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Moim Hossain
Netherlands Netherlands
Engineer Powered by the Cloud

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
radumi7-Mar-11 18:26
memberradumi7-Mar-11 18:26 
GeneralJust Two lines of code is need Pin
dkumbhar9-Jun-10 10:44
memberdkumbhar9-Jun-10 10:44 
GeneralNice codes Pin
Member 427330727-Mar-09 21:56
memberMember 427330727-Mar-09 21:56 
GeneralRe: Nice codes Pin
Moim Hossain27-Mar-09 21:57
memberMoim Hossain27-Mar-09 21:57 
GeneralYet another way of Exploring GAC in Windows Explorer Pin
JimmyRopes8-Oct-08 12:23
professionalJimmyRopes8-Oct-08 12:23 
General"Extract GAC Assemblies"...Thanks Pin
HolyRoot2-Oct-07 23:01
memberHolyRoot2-Oct-07 23:01 
GeneralRe: "Extract GAC Assemblies"...Thanks Pin
Moim Hossain3-Oct-07 1:40
memberMoim Hossain3-Oct-07 1:40 
vijaynats7-Jul-07 7:23
membervijaynats7-Jul-07 7:23 
GeneralRe: THANKYOU Pin
Moim Hossain7-Jul-07 18:06
memberMoim Hossain7-Jul-07 18:06 
Generalanother way Pin
Yifeng Ding12-Mar-07 14:17
memberYifeng Ding12-Mar-07 14:17 
GeneralRe: another way Pin
Moim Hossain3-Oct-07 1:41
memberMoim Hossain3-Oct-07 1:41 
GeneralJust use SUBST command Pin
stevenmcohn8-Jan-07 8:22
memberstevenmcohn8-Jan-07 8:22 
GeneralRe: Just use SUBST command Pin
Moim Hossain8-Jan-07 20:12
memberMoim Hossain8-Jan-07 20:12 
GeneralThanks Pin
Usman Shaheen6-Jan-07 22:27
memberUsman Shaheen6-Jan-07 22:27 
GeneralRe: Thanks Pin
Moim Hossain7-Jan-07 3:50
memberMoim Hossain7-Jan-07 3:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web04 | 2.8.190417.4 | Last Updated 6 Jan 2007
Article Copyright 2007 by Moim Hossain
Everything else Copyright © CodeProject, 1999-2019
Layout: fixed | fluid