简体   繁体   English

.NET如何查找哪个程序集引用哪个

[英].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.

相关问题 加载在运行时引用nuget依赖项的.NET Standard程序集? - Loading an .NET Standard assembly which references a nuget dependency at runtime? 如何知道使用哪个确切的.NET程序集 - How to know which exact .NET assembly is used 如何找出哪个程序集导致特定程序集位于 bin 文件夹中? - How to find out which assembly caused a specific assembly to be in the bin folder? 如何正确找到针对其构建程序集的.NET运行时? - How can I correctly find the .NET runtime against which an assembly has been built? 如何找到哪个.NET项目引用正在传递加载另一个程序集? - How can you find which .NET project reference is transitively loading another assembly? 我的项目引用了另一个引用第三方程序集的项目。 如何设置此第三方组件的装配路径? - My project references another project which references a 3rd party assembly. How do I set the assembly path for this 3rd party assembly? 如何找出需要GAC进行特定组装的应用程序? - How to find out which application requires a certain assembly from GAC? 我如何知道给定.NET程序集所针对的平台? - How do I know which platform a given .NET assembly targets? 如何在 C# 中创建一个可以被 MATLAB 使用的 .net 程序集? - How to create a .net assembly in C#, which can be consumed by MATLAB? 如何控制 .Net 在命名空间冲突中选择哪个程序集? - How to control which assembly .Net chooses in a namespace conflict?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM