<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ganshani.com &#187; gac</title>
	<atom:link href="http://www.ganshani.com/tag/gac/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ganshani.com</link>
	<description>Puneet Ghanshani - .NET, Silverlight, Sharepoint Articles, Blogs, Poems, Photograph</description>
	<lastBuildDate>Sat, 24 Apr 2010 10:17:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Retrieving GAC Assemblies and Information</title>
		<link>http://www.ganshani.com/2009/07/20/retrieving-gac-assemblies-and-information/</link>
		<comments>http://www.ganshani.com/2009/07/20/retrieving-gac-assemblies-and-information/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 05:19:35 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Microsoft .NET]]></category>
		<category><![CDATA[gac]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=234</guid>
		<description><![CDATA[
			
				
			
		
Retrieving GAC assemblies and their information.  This was a question posed by one of my colleagues while he was developing a product. Now the answer to this is little tweaky.
Follow these steps to get information such as:-

Assembly Name
Version
PublicKeyToken

I prefer not to use Reflection for this purpose and solving by a simple File Iteration method.
Iterate through [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F07%2F20%2Fretrieving-gac-assemblies-and-information%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F07%2F20%2Fretrieving-gac-assemblies-and-information%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Retrieving GAC assemblies and their information.  This was a question posed by one of <a title="Mail my friend" href="mailto:bhavin.barot.cts@gmail.com?subject=GAC-List-(clicked-from-ganshani.com)" target="_blank">my colleagues</a> while he was developing a product. Now the answer to this is little tweaky.</p>
<p>Follow these steps to get information such as:-</p>
<ol>
<li>Assembly Name</li>
<li>Version</li>
<li>PublicKeyToken</li>
</ol>
<p>I prefer not to use Reflection for this purpose and solving by a simple File Iteration method.</p>
<p><span style="text-decoration: underline;">Iterate through directories in GAC</span></p>
<p>System.IO.Directory.GetDirectories(@&#8221;C:WindowsAssemblyGAC&#8221;);</p>
<p>Now this GAC folder within Assembly is not visible in Windows Explorer, but you can see this on your Command Prompt.</p>
<p><span style="text-decoration: underline;">Iterate through Files in each directory in GAC</span></p>
<p>Files = System.IO.Directory.GetFiles(currentDirectory, &#8220;*.dll&#8221;);</p>
<p>This will give you the <strong>Assembly Name</strong>.</p>
<p><span style="text-decoration: underline;">Iterate through the directories in this folder</span></p>
<p>For example, C:WindowsassemblyGACADODB has only one folder: 7.0.3300.0__b03f5f7f11d50a3a</p>
<p>Split this by &#8216;_&#8217; to get two parts. Part-I represents the <strong>version of the assembly</strong> and Part-II represents <strong>PublicKeyToken</strong></p>
<p>This is faster than using reflection and is easy to develop as well.</p>
<p>Happy development!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2009/07/20/retrieving-gac-assemblies-and-information/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
