1

Which command line option of ILDASM dumps just the referenced assemblies? If it is not possible, is there an alternate tool/way to dump the references assemblies in a .NET DLL.

Chubsdad
  • 24,777
  • 4
  • 73
  • 129

1 Answers1

1

This is possible with Mono.Cecil:

string assemblyPath = "...";
ModuleDefinition module = ModuleDefinition.ReadModule(assemblyPath);
foreach (AssemblyNameReference reference in module.AssemblyReferences)
    Console.WriteLine(reference.Name);
Bradley Grainger
  • 27,458
  • 4
  • 91
  • 108
  • 2
    Do you see any issues with this idea? ildasm /ADVANCED /TEXT /ALL | findstr "extern" – Chubsdad Feb 21 '13 at 05:59
  • @Chubsdad: That will find any line in the output that contains the text "extern", which might bring back some false positives. Using `findstr /C:".assembly extern"` should work, though. It will probably be slower than just dumping the assembly references, since it will also disassemble all the IL. (But if it works for you, go ahead and answer your own question and accept it.) – Bradley Grainger Feb 21 '13 at 15:17