0

我正在尝试在 64 位机器上运行 32 位应用程序(构建为 x86)。我将它构建为 x86,因为它使用 32 位 com 对象。在我这样做之前,该应用程序无法加载 com. 现在它加载了 com,但抱怨它找不到 microsoft.mshtml 程序集。此程序集由 (.net) 依赖项之一使用。

错误信息是:

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
Couldn't find File name: 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

我可以看到这个程序集在 CLSID 和 WOW3264NodeCLSID 下都注册了。但是,在 WINdows\Assembly 目录中找不到它。

我试图从构建应用程序的计算机上复制 dll 并将其放入应用程序目录中。然后,当我尝试运行该应用程序时,我收到了关于强命名的安全错误。我用谷歌搜索了错误,发现程序集应该添加到 GAC 中。我试图通过将 dll 拖入来做到这一点\windows\assembly,但这也不起作用。它给了我一条关于私钥\公钥的错误消息。

我启用了绑定日志记录,这就是我得到的:

=== 预绑定状态信息 ===

LOG: DisplayName = Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
 (Fully-specified)
LOG: Appbase = file:///C:/DT/IEService/bin/Debug32bit/
LOG: Initial PrivatePath = NULL
Calling assembly : HTMLConverter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=6ec4c8772a0842ff.

LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\DT\IEService\bin\Debug32bit\ServiceConsole.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: The same bind was seen before, and was failed with hr = 0x80070002.

我应该怎么办?任何帮助将不胜感激。

4

1 回答 1

0

在机器上运行 fslogvw 以捕获有关程序集绑定失败的其他信息。这应该有助于解决问题。

于 2009-06-09T23:28:46.877 回答