I've a directory with a large number of dlls
. I need to find all those that reference a specific dll
.
I'm thinking about the following solution :
ildasm
manifest
into a text file Yet this solution feels immensely wrong to me. Is there a better way to achieve it?
You could write a small tool for that purpose, using Reflection to find the referenced assemblies:
string[] fileNames = ...; // get all the filenames
foreach (string fileName in fileNames) {
var assembly = System.Reflection.Assembly.ReflectionOnlyLoadFrom(fileName);
var referencedAssemblies = assembly.GetReferencedAssemblies();
foreach (var assemblyName in referencedAssemblies) {
// do your comparison
}
}