我正在尝试在64位机器上运行一个32位应用程序(构建为x86)。我将其构建为x86,因为它使用32位com对象。在我这样做之前,应用程序无法加载com。现在它加载com,但抱怨找不到microsoft.mshtml程序集。其中一个(.net)依赖项使用THis程序集。
错误消息为:
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.我该怎么办?任何帮助都将不胜感激。
发布于 2009-06-09 23:28:47
在机器上运行fslogvw以捕获有关程序集绑定失败的其他信息。这应该有助于追查原因。
https://stackoverflow.com/questions/973004
复制相似问题