COM异常 - TYPE_E_CANTLOADLIBRARY? [英] COM Exception - TYPE_E_CANTLOADLIBRARY?

查看:895
本文介绍了COM异常 - TYPE_E_CANTLOADLIBRARY?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用我的.NET Web应用程序中的COM DLL。这适用于多个不同的机器上的罚款。结果
但是一个特定的机器上,我得到以下错误:

I am using a COM dll in my .Net web application. This works fine on multiple different machines.
However on one particular machine I get the following error:

无法投类型的COM对象CServer.CApplicationClass接口类型CServer.ICApplication。此操作失败的原因是对IID{CF0DFA28-046B-4C7D-8AA9-F4B7477D8CAE}接口的COM组件调用QueryInterface失败,原因是以下错误:错误加载类型库/ DLL。 (从HRESULT异常:0x80029C4A(TYPE_E_CANTLOADLIBRARY))。

Unable to cast COM object of type 'CServer.CApplicationClass' to interface type 'CServer.ICApplication'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{CF0DFA28-046B-4C7D-8AA9-F4B7477D8CAE} ' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

我已经registerd使用 REGSVR32 命令的DLL。结果
我也创建了这个DLL COM +应用程序。
通过运行注册表结果搜索
我可以找到许多地方的关键。
我也曾尝试注销DLL和删除计算机上的所有referneces这个DLL。事后重新添加DLL并重新注册它。

I have registerd the dll using the regsvr32 command.
I have also created a COM+ application for this dll. Running a search through the registry
I can find the key in numerous places. I have also tried unregistering the dll and deleting all referneces on the computer to this dll. And afterwards re-adding the dll and re-registering it.

我写这些测试DLL一个简单的Windows脚本文件。这工作得很好。然而,问题是在IIS中运行我的.NET项目存在。

I have written a simple windows script file which tests the dll. This works fine. However the problem exists in my .net project which is running in iis.

谁能帮我?..

如果您需要了信息,请发表评论。谢谢你。

If you need anymore info please leave a comment. Thanks.

推荐答案

我也有类似的问题,用TYPE_E_CANTLOADLIBRARY消息。

I had a similar problem, with the "TYPE_E_CANTLOADLIBRARY" message.

背景:
我用这一个Interop.ReferenceA.dll项目。此文件是使用TLBIMP ReferenceA.dll /创建出来。Interop.ReferenceA.dll

Background: I had a project which used Interop.ReferenceA.dll. This file was created using tlbimp ReferenceA.dll /out: Interop.ReferenceA.dll.

解决方案:
当我使用RegDllView看了看ReferenceA.dll我注意到ReferenceA.dll有一个子类,这是在错误消息中显示的IID。
我在子类的源$ C ​​$ C环顾四周,发现它有一个依赖于Interop.ReferenceB.dll。

Solution: When I took a look at ReferenceA.dll using RegDllView I noticed that ReferenceA.dll had a subclass, which was the IID shown in the error message. I looked around in the source code of the subclass and noticed that it had a dependency to Interop.ReferenceB.dll.

原来,需要Interop.ReferenceB作为一个类型库子类的工作。于是我就这样的:

Turns out that the subclass needed Interop.ReferenceB as a type-library to work. So I ran this:

regasm /tlb:Interop.ReferenceB.tlb Interop.ReferenceB.dll(使用regasm的32位版本。)

regasm /tlb:Interop.ReferenceB.tlb Interop.ReferenceB.dll (the 32-bit version of regasm was used.)

和错误走了。

这篇关于COM异常 - TYPE_E_CANTLOADLIBRARY?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆