简体   繁体   中英

.NET How to find which assembly references which

We have quite old project. where a host (console or windows service) loads bunch of "plugins" which are dlls.. some of them from nugets, some from 3d party distributions, some compiled in other solutions and copied by hand etc..

there are almost a hundred of them.. and the guy who did it left years ago..

recently I got System.IO.FileLoadException, the infamous error 0x80131040 . One of dlls was trying to load incorrect version of another dll.. it took me few hours to find which assembly was it.

I enabled Fusion log but all it told me - which version of dll was it looking for and which one it did find..

there was no information on which dll actually referenced the wrong dll..

it would only print the host name ie console.exe but not the referencing dll name .

I could potentially go through the whole hundred of them with Reflector looking into the references.. Or write a quick app to load all assemblies and try to recover theirs metadata.. but it would take hours

Anyone knows a faster way to find which dll references a particular dll by name?

System.IO.FileLoadException provides PublicKeyToken for missing assembly. Just go into your project's bin folder and search for dlls that contain text equal to public key token

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM