【问题标题】:Can't load .dll file (HRESULT 0x80070002)无法加载 .dll 文件 (HRESULT 0x80070002)
【发布时间】:2013-08-26 12:13:15
【问题描述】:

Eclipse 确实会寻找我的插件需要执行的 .dll 文件。这是文件的完整路径:

C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n.w32.v20-0.8.6.0

尝试这样打开它:

public class Main {

  public static void main(String[] args) {

    File f = new File("C:\\Eclipse\\eclipse-sib\\eclipse\\configuration\\org.eclipse.osgi\\bundles\\324\\1\\.cp\\jni4net.n-0.8.6.0.dll");

    System.out.println(f.getName() + " " + f.getAbsolutePath());
  }

}

确实有效!

Output:
jni4net.n-0.8.6.0.dll C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n-0.8.6.0.dll

但是当我在文件被访问时运行我的插件时,我会收到以下信息:

使用FUSLOGVW.EXE 表示相同:

*** Assembly Binder Log Entry  (26.08.2013 @ 13:53:35) ***

The operation failed.
Bind result: hr = 0x80070002. The system cannot find the file specified.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable  C:\Eclipse\eclipse-sib\eclipse\eclipsec.exe
--- A detailed error log follows. 

LOG: IJW explicit bind. File path:C:\Eclipse\eclipse-sib\eclipse\configuration\org.eclipse.osgi\bundles\324\1\.cp\jni4net.n-0.8.6.0.dll.

有人知道问题可能是什么吗?

【问题讨论】:

    标签: c# java dll eclipse-plugin fuslogvw


    【解决方案1】:

    我认为这个错误可能是因为缺少对“jni4net.n-0.8.6.0.dll”的依赖。 在 Windows 上,我建议使用 FileMon/ProcessMonitor 来检查 Eclipse 在该错误之前尝试加载哪些文件/dll。

    【讨论】:

    • 查看depends,看看是否有文档中没有明确提到的依赖。要真正了解发生了什么,请从live.sysinternals.com 运行 procmon.exe 以查看来自 Eclipse 的实际内核调用。您可能会对在此过程中搜索文件的位置感到惊讶。
    【解决方案2】:

    文件名结尾为:jni4net.n.w32.v20-0.8.6.0 而不是你使用的:jni4net.n-0.8.6.0.dll

    【讨论】:

      猜你喜欢
      • 2012-02-18
      • 1970-01-01
      • 1970-01-01
      • 2022-10-24
      • 2021-05-05
      • 2012-03-25
      • 2014-07-03
      • 1970-01-01
      • 2019-08-21
      相关资源
      最近更新 更多