views:

38

answers:

1

Is there a way to scan all the assemblies in the GAC and return a list of names of assemblies with a specified Public Key Token during runtime? I know the Public Key of all the GAC assemblies that I am interested in loading, but don't necessarily know the names or version numbers.

+1  A: 

Long time ago but I think the public key is part of the directory names where the assemblies are stored. So maybe you could just loop through all the subdirs in the Assembly folder and see if any of the sub dirs contains the public key. Seem to remember that the sub dir format is something like version_somethingIcan'tRemember_publicKey.

If you don't already know, Windows Explorer hides the real layout of the Assembly folder but you can open a command prompt and CD into it. Just remember that any assemblies can be under any of multiple of the direct sub directories to the Assembly folder so probably safest to loop through all of them.

ho1
Thanks I'll try to create a custom AssemblyInfo object to build the full name I'll need to load the assembly.
lumberjack4