2014-08-27 60 views
0

我在ASPX一个项目,vb.net和这个应用程序调用COM + DLL,这个DLL读取注册表项,在我的VB6应用程序正确地使用这个DLL,但在我的.NET项目中添加此DLL的引用,我得到下面这个错误:ASP.NET项目调用VB6 Ddll,错误REGDB_E_READREGDB

有人能帮我解决这个错误,请...

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 27/8/2014 11:25:13 
Event time (UTC): 27/8/2014 14:25:13 
Event ID: c94e2752e983457cb159dc7d9e5f75a1 
Event sequence: 7 
Event occurrence: 1 
Event detail code: 0 

应用程序信息:

Application domain: /LM/W3SVC/1/Root/Constito-1-130536231061632161 
Trust level: Full 
Application Virtual Path: /Constito 
Application Path: C:\Constito\ 
Machine name: SERVER-Constito 

过程信息N:

Process ID: 7116 
Process name: w3wp.exe 
Account name: NT AUTHORITY\NETWORK SERVICE 

异常信息:

Exception type: Exception 
    Exception message: 
     Unable to cast COM object of type 'System.__ComObject' to interface type 'U_Master.Obj'. 
     This operation failed because the QueryInterface 
    call on the COM component for the interface 
    with IID '{BE0634D8-325E-4A3E-9426-44D52F118BF9}' 
    failed due to the following error: 
    Could not read key from registry 
    (Exception from HRESULT: 0x80040150 (REGDB_E_READREGDB)). 
    at Constito.Master.Post_DadosVB6(Object obj, String acao, String xmlArg, String p_cd_usuario) in C:\Constito\Master.vb:line 102 
    at Constito.Principal.Page_Load(Object sender, EventArgs e) in C:\Constito\Principal.aspx.vb:line 30 
    at System.Web.UI.Control.OnLoad(EventArgs e) 
    at System.Web.UI.Control.LoadRecursive() 
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean 
includeStagesAfterAsyncPoint) 
+0

为什么这个帖子被downvoted?我看不出有什么意见来解释为什么和信息是好的。 – 2014-08-27 15:51:09

回答

1

尝试将应用程序池用户与Web服务器上的本地管理员权限设置为一个帐户。

它看起来像一个注册表权限问题。

如果不是这样,它确保GUID(BE0634D8-325E-4A3E-9426-44D52F118BF9)存在于HKEY_CLASSES_ROOT配置单元中。

+0

THX山姆马尔,你是完全地正确的...现在它的作品对我来说,THX很多! – 2014-08-27 21:04:39