.netassembliesassembly-resolutionfuslogvw

Discovering which assemblies are loading which dependencies (at runtime)


What's the easiest way to discover which assembly is triggering certain dependencies to be loaded at runtime? I've got a stray reference to an old assembly somewhere, in one of the 100+ assemblies that get loaded as part of our application.

Using FUSLOGVW I can see the old assembly being loaded - but the logs don't tell me which assembly has caused it to load. I've used CheckASM which allows me to browse the dependencies of the primary assembly, and explore down the tree - but these are all fine.

So it must be an assembly that's being loaded dynamically at runtime, or a configuration file somewhere. But I can't find it for the life of me.

Was wondering if there was a smarter way to do this?


Solution

  • Perhaps you can subscribe to AssemblyResolve event in all app domains (if there are not too many). ResolveEventArgs contains special field for this - ResolveEventArgs.RequestingAssembly