Home All Groups Group Topic Archive Search About

Possible to read meta from assembly without loading it?

Author
9 Aug 2006 7:38 AM
MariusI
I was wondering if its possible to extracts metadata from an assembly without
loading it. For example: consider an app which loads dlls from a specified
directory and is only interested in dlls from a specific vendor. Can I
retrieve this information on a file-level. I could of course create a
separate AppDomain and sandbox the dlls, extract metadata and unload the
appdomain, then reload the assemblies i'm interested in. The operation is
done at startup, and such an approach would generate a lot of overhead at a
time where speed is of essence. Any alternative suggestions?

Author
9 Aug 2006 8:15 AM
Vadym Stetsyak
Hello, MariusI!

M> I was wondering if its possible to extracts metadata from an assembly
M> without loading it. For example: consider an app which loads dlls from a
M> specified directory and is only interested in dlls from a specific
M> vendor. Can I retrieve this information on a file-level.

Look at IMetaDataImport and related interfaces. See

%FrameworkSDKDir%\Tool Developers Guide\docs\Metadata Unmanaged
API.doc

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com

AddThis Social Bookmark Button