1

好的,这行代码:

XMLHTTP40 http = new XMLHTTP40();

抛出一个System.Runtime.InteropServices.COMException并抱怨:

由于以下错误,检索具有 CLSID {88D969C5-F192-11D4-A65F-0040963251E5} 的组件的 COM 类工厂失败:80040154。

我已经用谷歌搜索过了,我猜这个 DLL 需要注册,因为它是一个 COM DLL。没关系,但是当我尝试注册它时,我收到了这个错误:

C:\some\directory\path\etc\Interop.MSXML2.dll 已加载,但未找到 DllRegisterServer 入口点。
无法注册此文件。

显然这是在另一个人的盒子上工作(他写了代码,所以是的......:P)。这个 COM 对象没有出现在我的可用 COM 引用列表中,所以我只引用位于项目 bin\Debug 目录中的 DLL。当我将此 DLL 的引用添加到我的项目时,我可以访问 VisualStudio 中的所有符号。我想知道,我可以安装什么东西来注册 DLL 并让它显示在我可以引用的 COM 对象列表中吗?我安装了我认为是 MSXML 4.0 库,但是当我查看目录时,里面什么都没有。

有任何想法吗?

4

2 回答 2

5

You need to actually have MSXML4 installed on your box for it to work. THe interop dll doesn't contain any runtime code it only helps .NET talk to MSXML4.

However why would you not use the System.Xml namespace instead of using a COM component?

于 2009-08-20T12:01:28.497 回答
0

您需要注册 (regsvr32) msxml4.dll,而不是互操作程序集。msxml4.dll 是 COM 服务器。

于 2009-08-20T11:59:12.773 回答