日期:2014-05-18  浏览次数:20451 次

NET dll引用疑难问题
大家好,本人非编程专业,我在这里是第一次发问题,谢谢大家!


1 本人用VS2010 写了个程序,程序中引用了VB写的一个DLL(此DLL 在C# 项目和ASP NET 中使用),程序在其他的机器(WIN 2003)运行正常,而在新装的一台机器WIN2003 上不能使用,出现如下信息:

Server Error in '/Nike_debug' Application.
--------------------------------------------

Unable to cast COM object of type 'xbox360.Class1Class' to interface type 'xbox360._Class1'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{799D4015-CA54-46CB-868F-54C780928B9F}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)). 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.InvalidCastException: Unable to cast COM object of type 'xbox360.Class1Class' to interface type 'xbox360._Class1'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{799D4015-CA54-46CB-868F-54C780928B9F}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Source Error: 


Line 113:  
Line 114:
Line 115: return my_dll_class.system_time();
Line 116: //global_variable.shi_jian_shu_xing = my_dll_class.shi_jian_shu_xing(global_variable.system_time);

 
2 将VS2010 在故障机器上安装重新引用再编译,同样出现错误,出错内容不一样,报类的某些方法不存在,用对象浏览器查看,确实已经丢失了,查看引用后的文件(Interop.xbox360.dll)比正常机器的体积小了很多,正常机器的8KB,当前的为4KB.

3 重装系统两次,故障依旧, 请高人指教,谢谢!

------解决方案--------------------
首先关注一下,我也碰到类似的问题,调用DCOM组件的时候报这个错误,至今没有解决!