无法加载DLL依赖项。如何阅读fuslogvw?

时间:2015-08-24 01:51:28

标签: c# .net debugging dll reference

背景

<小时/> 我正在使用默认的Kinect Fusion演示进行3D扫描的C#程序。我为这个程序添加了很多不同的东西,我差不多完成了。它通过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中打开它时,我也收到消息“调用堆栈只包含外部代码”。当我禁用“Just My Code”时,我基本上显示了一些机器代码语言或其他任何东西。我不认为它非常重要,所以我不会把它放在这里。如果需要查看此代码,请通知我,我会在此处发布。

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

我尝试了什么

<小时/> 经过一些阅读后,我当然发现我得到了这个错误,因为程序中缺少一个引用/依赖。这对我来说有点奇怪,因为它在调试中起作用。无论如何,我试图提出并尝试找到我失踪的东西。我在文件上使用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引用的东西。我只是使用所有可用的文件(据我所知)作为目标文件,但我可能会遗漏一些东西。

installer files

1 个答案:

答案 0 :(得分: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复制到非工作环境。