none
How to get .Net assembly location using C++? RRS feed

  • Question

  • Hi, My C++ application needs to find all the assemblies referenced from a given .Net assemblies. Then it needs to tell in which location each dependent assembly resides (current dir, GAC, etc.).

    So I use IMetaDataAssemblyImport::GetAssemblyRefProps() to get the referenced assemblies.
    Then for each dependent assembly, I build its strong name and call IMetaDataAssemblyImport::FindAssembliesByName(). It does return the assembly data, but with no location (path).

    Here I'm stuck. I tried to get the assembly's file using EnumFiles(), but I always get 0 files.
    Only for mscorlib I get a list of 13 files, but without thier path.

    Any idea how can I tell where the assembly is physically found?

    TIA
    Sruli

    • Moved by Jesse Jiang Monday, January 10, 2011 2:44 AM (From:Visual C++ General)
    Thursday, January 6, 2011 3:01 PM

Answers

All replies