【问题标题】:Dll dependency could not be loaded. How to read fuslogvw?无法加载 DLL 依赖项。如何阅读 fuslogvw?
【发布时间】:2015-08-24 01:51:28
【问题描述】:

背景


我正在用 C# 编写一个程序,该程序使用默认的 Kinect Fusion 演示进行 3D 扫描。我在这个程序中添加了很多不同的东西,我快完成了。它可以通过 VS2013 上的调试完美运行。我还创建了一个安装程序,但是当我运行安装的应用程序时出现一些错误,我将在下面放置。我使用的是日文版的 Windows(8.1 64 位),这意味着我必须翻译所有显示给我的错误。这意味着我在这里展示的错误可能不是 100% 合乎逻辑或正确的。我对 C# 也不是很有经验,所以我可能会在这里忽略一些非常基本的东西。因此,请随时提出任何问题。我很可能就是这样,因为我对这些东西不太了解,所以对于更有经验的人来说,我可能错过了一些非常容易的事情。

关于该计划的更多信息:

  • 它的活动解决方案平台是 x64(它仍然安装在 x86 中,不确定是否重要);
  • 运行前需要管理员权限;
  • “Program Files (x86)”中有另一个同名目录 (3D-Scanner),其中包含移除地板所需的不同应用程序。这可能会混淆查找/搜索的可能性吗?我最初的计划是让他们进入同一张地图,但系统创建了两张相同的地图;
  • 我使用的默认 Kinect Fusion 程序是 64 位的。我之前遇到了一些麻烦,因为我的应用程序无法将 64 位引用的安装程序创建为 32 位项目。我将它切换到 64 位项目,安装程序似乎工作正常(除了缺少的 dll 引用)。

错误


当应用程序崩溃并开始使用 VS2013 调试它时,我收到以下错误:
An unhandled exception of type 'System.IO.FileLoadException' occurred in PresentationCore.dll

Additional information: 
    file or assembly 'Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35', or one of its dependencies could not be loaded. 
    Manifest definition of the found assembly does not match the assembly reference. (Exception from HRESULT: 0x80131040)

当我在 VS2013 中打开它时,我还会收到消息“调用堆栈仅包含外部代码”。当我禁用“只是我的代码”时,我基本上会看到一些机器代码语言或其他任何语言。我认为它不是很相关,所以我不会把它放在这里。如果需要查看此代码,请通知我,我将在此处发布。

以下被列为“带有外部代码的调用堆栈”(我必须使用图像,因为调用堆栈不可复制):

我尝试了什么


好吧,经过一番阅读,我当然发现我收到了这个错误,因为程序中缺少引用/依赖项。这对我来说有点奇怪,因为它适用于调试。无论如何,我试图提出并试图找到我所缺少的东西。我在文件上使用了dependency walker 来查看它会带来什么,但我无法充分利用它。这是如此庞大的数据量,我不知道我在寻找什么。

所以我启动了Fuslogvw.exe,看看我是否可以通过这种方式找到一些错误。它确实让我更接近了。输出似乎更合乎逻辑,但我仍然不知道我在寻找什么。再次请注意,由于我正在使用日语系统,我不得不翻译这些日志,这就是日志看起来有点不对劲的原因。这是程序的工作调试版本上Microsoft.Kinect.Fusion dll 的输出(我认为这是造成问题的那个):

 *** Assembly bind log entry (2015/08/24 @ 10:38:40) ***

 We were successful in the operation.
 Bind Result:. Hr = 0x0 I The operation completed successfully.

 Assembly manager to read from: C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ clr.dll
 It is running under the executable file.  C: \ Users \ bono \ Documents \ Visual Studio 2013 \ Projects \ 3D-Scanner \ 3D-Scanner \ bin \ x64 \ Release \ 3D-Scanner.vshost.exe
 --- Detailed error log is as follows.

 === Pre-bind state information ===
 Log: DisplayName = Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35
  (Fully-specified)
 Log: Appbase = file: /// C: / Users / bono / documents / visual studio 2013 / Projects / 3D-Scanner / 3D-Scanner / bin / x64 / Release /
 Log: Initial PrivatePath = NULL
 Log: Dynamic Base = NULL
 Log: Cache Base = NULL
 Log: AppName = 3D-Scanner.vshost.exe
 the calling assembly: 3D-Scanner, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null
 ===
 Log: This bind starts in read context of default.
 Log: The application configuration file C: I use the \ Users \ bono \ documents \ visual studio 2013 \ Projects \ 3D-Scanner \ 3D-Scanner \ bin \ x64 \ Release \ 3D-Scanner.vshost.exe.Config.
 Log: I use the host configuration file.
 Log: C: I use the computer configuration file from the \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ config \ machine.config.
 Log: reference after policy: Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35
 Log: I failed to GAC look up.
 Log: A new URL file: /// C: / Users / bono / documents / visual studio 2013 / Projects / 3D-Scanner / 3D-Scanner / bin / x64 / Release / Microsoft.Kinect.Fusion.DLL and trying to download You.
 Log: I succeeded in downloading the assembly.  The next file you are trying to set up: C: \ Users \ bono \ documents \ visual studio 2013 \ Projects \ 3D-Scanner \ 3D-Scanner \ bin \ x64 \ Release \ Microsoft.Kinect.Fusion.dll
 Log: I went into the setup phase of execution from the source.
 Log: assembly name Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, is PublicKeyToken = 31bf3856ad364e35.
 Log: I succeeded to bind.  C: it will return the \ Users \ bono \ documents \ visual studio 2013 \ Projects \ 3D-Scanner \ 3D-Scanner \ bin \ assembly from x64 \ Release \ Microsoft.Kinect.Fusion.dll.
 Error: the assembly has been loaded in the default read context.

这里是非工作程序的安装版本:

 *** Assembly bind log entry (2015/08/24 @ 10:34:17) ***

 It failed in operation.
 Bind Result:. Hr = 0x80131040 but there is no description.

 Assembly manager to read from: C: \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ clr.dll
 It is running under the executable file.  C: \ Program Files (x86) \ 3D-Scanner \ 3D-Scanner \ 3D-Scanner.exe
 --- Detailed error log is as follows.

 === Pre-bind state information ===
 Log: DisplayName = Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35
  (Fully-specified)
 Log: Appbase = file: /// C: / Program Files (x86) / 3D-Scanner / 3D-Scanner /
 Log: Initial PrivatePath = NULL
 Log: Dynamic Base = NULL
 Log: Cache Base = NULL
 Log: AppName = 3D-Scanner.exe
 the calling assembly: 3D-Scanner, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null
 ===
 Log: This bind starts in read context of default.
 Log: The application configuration file C: I use the \ Program Files (x86) \ 3D-Scanner \ 3D-Scanner \ 3D-Scanner.exe.Config.
 Log: I use the host configuration file.
 Log: C: I use the computer configuration file from the \ Windows \ Microsoft.NET \ Framework64 \ v4.0.30319 \ config \ machine.config.
 Log: reference after policy: Microsoft.Kinect.Fusion, Version = 2.0.0.0, Culture = neutral, PublicKeyToken = 31bf3856ad364e35
 Log: I failed to GAC look up.
 Log: A new URL file: /// C: / Program Files I am trying to download the (x86) /3D-Scanner/3D-Scanner/Microsoft.Kinect.Fusion.DLL.
 Log: I succeeded in downloading the assembly.  The next file you are trying to set up: C: \ Program Files (x86) \ 3D-Scanner \ 3D-Scanner \ Microsoft.Kinect.Fusion.dll
 Log: I went into the setup phase of execution from the source.
 Log: assembly name Microsoft.Kinect.Fusion, Version = 0.0.0.0, Culture = neutral, is PublicKeyToken = null.
 Warning: The results of the comparison of the assembly name, mismatch of Major Version found.
 Error: assembly references, it did not match the found assembly definition.
 Error: set-up phase of execution from the source failed (hr = 0x80131040).
 Error: Could not complete the setup of assembly (hr = 0x80131040).  Survey it was canceled.

我认为丢失的信息在某处,但我不知道如何理解它。在挑选有用信息时,我将不胜感激。

附加信息


我不确定这是否完全有必要,但我认为显示我的安装程序文件可能是值得的。也许我错过了在其中包含导致缺少 dll 引用的内容。我只是使用所有可用文件(据我所知)作为目标文件,但我可能会遗漏一些东西。

【问题讨论】:

  • 安装路径中可用的 Microsoft.Kinect.Fusion.dll 版本是什么。好像是版本不匹配。
  • @Taleeb 嗯,我认为出于某种原因可能是 0.0.0.0(我假设我可以通过以下方式检查:属性 -> 最右边的选项卡 -> 文件版本?)。
  • 是的 - 日志中提到的版本也是 0.0.0.0(虽然它需要 2.0.0.0 版本)。就我个人而言,我不知道 Microsoft.Kinect.Fusion ......但你可以将 dll 从你的工作环境复制到非工作环境吗 - 这有望解决你的问题

标签: c# .net debugging dll reference


【解决方案1】:

这看起来像是版本不匹配的问题。非工作环境的日志显示找到的版本是 0.0.0.0,而预期的版本是 2.0.0.0。

Log: assembly name Microsoft.Kinect.Fusion, Version = 0.0.0.0, Culture = neutral, is PublicKeyToken = null.
Warning: The results of the comparison of the assembly name, mismatch of Major Version found.
Error: assembly references, it did not match the found assembly definition.
Error: set-up phase of execution from the source failed (hr = 0x80131040).
Error: Could not complete the setup of assembly (hr = 0x80131040).  Survey it was canceled.

要解决此问题 - 将正确版本的 dll 复制到非工作环境。

【讨论】:

  • 嗯,这比我预期的要容易很多。我看到这是不匹配的,但认为这是由于缺少参考或其他原因。将不同的版本复制到安装目录中是有效的(并非所有版本都这样做,但我找到了一个)。我已经强行把它放在安装程序项目输出文件中,安装后它现在可以工作了。谢谢!
猜你喜欢
  • 2021-08-05
  • 1970-01-01
  • 1970-01-01
  • 2016-12-08
  • 2020-04-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多