[英].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.. 主机(控制台或Windows服务)在其中加载一堆“ dll”插件。其中一些来自nuget,一些来自3d party发行版,一些在其他解决方案中编译并手动复制等。
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
. 最近我得到了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. 其中一个dll试图加载另一个dll的错误版本。.我花了几个小时才找到它是哪个程序集。
I enabled Fusion log but all it told me - which version of dll was it looking for and which one it did find.. 我启用了Fusion日志,但所有信息都告诉我-它正在寻找哪个版本的dll,以及它找到了哪个版本。
there was no information on which dll actually referenced the wrong dll.. 没有有关哪个dll实际引用错误的dll的信息。
it would only print the host name ie console.exe but not the referencing dll name . 它只会打印主机名,即console.exe, 而不打印引用的dll名称 。
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 我可能会用Reflector来查找引用中的全部内容。或编写一个快速应用程序以加载所有程序集并尝试恢复其元数据..但这将需要几个小时
Anyone knows a faster way to find which dll references a particular dll by name? 有谁知道一种更快的方法来查找哪个dll通过名称引用特定的dll?
System.IO.FileLoadException provides PublicKeyToken for missing assembly. System.IO.FileLoadException为缺少的程序集提供PublicKeyToken。 Just go into your project's bin folder and search for dlls that contain text equal to public key token 只需进入项目的bin文件夹并搜索包含等于公钥令牌的文本的dll。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.