Home All Groups Group Topic Archive Search About

get a listing of assemblies from GAC ?

Author
8 Mar 2006 5:15 PM
Ravi Shankar
Hi,

How can I in a program obtain the list of assemblies installed in GAC ?
Is it also possible to get this list based on certain assembly properties
such as all assemblies referencing a specific assembly also ?

I wish to do so using VB.Net (in VS2003)

--
Ravi Shankar

Author
8 Mar 2006 6:18 PM
Mattias Sjögren
>How can I in a program obtain the list of assemblies installed in GAC ?

Fusion provides a COM based API for working with the GAC. See
http://www.msjogren.net/dotnet/eng/samples/dotnet_gactool.asp


>Is it also possible to get this list based on certain assembly properties
>such as all assemblies referencing a specific assembly also ?

No, you'd have to load each assembly found and check its assembly
refs.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
9 Mar 2006 6:00 AM
Kevin Yu [MSFT]
Hi Ravi,

You can use code to browse in the c:\windows\assembly directory because all
the GAC assemblies are there. Actually, the GAC utility is using this
method to get the list of assemblies.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
Author
9 Mar 2006 6:20 AM
Mattias Sjögren
>You can use code to browse in the c:\windows\assembly directory because all
>the GAC assemblies are there.

Not directly, they are in different subdirectories of that directory.
But that's an implementation detail. Surely you don't want to depend
on something like that when there's a published API for working with
the GAC.


>Actually, the GAC utility is using this method to get the list of assemblies.

Which GAC utility? AFAIK, both Gacutil.exe and the Shell extension
uses the fusion APIs.


Mattias

--
Mattias Sjögren [C# MVP]  mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Author
9 Mar 2006 6:38 AM
Ravi Shankar
Hi Mattias,

I had downloaded and read the KB 317540 you mention on the site. You also
mention that the SHfusion.dll API are not documented or shfusion exposes the
API as defined in the KB ?

The base intent is to get a dropdown in VS (design time) for a component I'm
writing where I wish to expose a property that permits uses to select a
deployed assembly. There is perhaps a default type (datatype) I could use to
enable the "Property Browser" in VS to pop up this list ? I assumed there
wouldn't be anything like this so I'd need to write my own UI to popup this
list.
--
Ravi Shankar


Show quoteHide quote
"Mattias Sjögren" wrote:

> >How can I in a program obtain the list of assemblies installed in GAC ?
>
> Fusion provides a COM based API for working with the GAC. See
> http://www.msjogren.net/dotnet/eng/samples/dotnet_gactool.asp
>
>
> >Is it also possible to get this list based on certain assembly properties
> >such as all assemblies referencing a specific assembly also ?
>
> No, you'd have to load each assembly found and check its assembly
> refs.
>
>
> Mattias
>
> --
> Mattias Sjögren [C# MVP]  mattias @ mvps.org
> http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
> Please reply only to the newsgroup.
>