Search code examples
c#com-interop

Retrieving the COM class factory for component with CLSID


I am using VB6 DLL in ASP.Net web site, when I add the reference of VB6 DLL it got added as a Interop.X.DLL and it compiled and executed properly. But when I published the website on Windows Server 2003 with IIS 6.0 and executed it gives the error "Retrieving the COM class factory for component with CLSID {82EA3A98-AD80-4250-9EEF-5B8001F65091} failed due to the following error: 80040154"

I have not registered the interop.X.DLL on Windows Server 2003.

Please help me to solve this problem.


Solution

  • COM error 80040154 indicates that your COM component hasn't been properly registered.

    A typical problem is that IIS usually runs under a different account. Check the Registry using regedit.exe and make sure the registration is present in the following key:

    HKLM\Software\Classes\CLSID\{your guid}
    

    and not in HKCU or HKCR only. If it is not present, re-register the COM component with regsvr32 using an administrator account.

    Should you be running on an x64 edition of Windows Server, make sure that you select the 32-bit version of regsvr32 under C:\Windows\SysWOW64.