如何调试"无法加载文件或程序集"运行时错误?加载、错误、文件、程序

2023-09-02 01:50:10 作者:难得心动

我有一个使用使用 IKVM 一个Java库转换项目。我加入了创建DLL加上所有可能的IKVM的DLL引用到我的项目,但是当我运行它,我得到以下运行时错误:

I have a project that uses a Java library converted using IKVM. I added the created DLL plus all possible IKVM DLLs as references to my project, but when I run it, I get the following runtime error:

System.IO.FileNotFoundException:找不到无法加载文件或程序的核心,版本= 0.0.0.0,文化=中性公钥= null或它的一个依赖。该系统找不到指定的文件。

System.IO.FileNotFoundException : Could not load file or assembly 'core, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

我真的不知道如何调试这个错误。有没有办法知道到底哪种类型的缺失?从描述我猜这是生成的DLL(从Java的lib),但我已经正确地增加一条,作为参考。

I'm not really sure how to debug this error. Is there a way to know exactly which type is missing? From the description I'd guess this is the generated DLL (from the Java lib) but I have properly added it as reference.

还有什么我做错了?

推荐答案

您可以使用的融合日志查看器来调试组件加载问题,在.NET应用程序。

You can use the Fusion Log Viewer to debug assembly loading problems in .NET apps.

此外,进程监视器是确定一般的文件加载问题非常有用的。

Also, Process Monitor is very useful in identifying general file-load problems.

 
精彩推荐