Jose Rodriguez
Jose Rodriguez

Reputation: 10182

.NET 0x80040154 (REGDB_E_CLASSNOTREG): Retrieving the COM class factory for component with CLSID {XXXX}

I´m trying to run COM.Scanner project but the follow exception is thrown:

Retrieving the COM class factory for component with CLSID {9F8D4F16-0F61-4A38-98B3-1F6F80F11C87} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

Like Interop.CoreScanner is a .NET assembly I use regasm to register the COM objects, but the error still occurs.

I come to read this good post but none of answers solved the problem.

This the information of Corflags:

Microsoft (R) .NET Framework CorFlags Conversion Tool.  Version  4.6.81.0
Copyright (c) Microsoft Corporation.  All rights reserved.

Version   : v2.0.50727
CLR Header: 2.5
PE        : PE32
CorFlags  : 0x1
ILONLY    : 1
32BITREQ  : 0
32BITPREF : 0
Signed    : 0

The generated .reg file with regasm and /regfile option is:

REGEDIT4

[HKEY_CLASSES_ROOT\CLSID\{9F8D4F16-0F61-4A38-98B3-1F6F80F11C87}\InprocServer32]
"Class"="CoreScanner.CCoreScannerClass"
"Assembly"="Interop.CoreScanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///D:/Github/miscelaneas/COM.Scanner/libs/Interop.CoreScanner.dll"

[HKEY_CLASSES_ROOT\CLSID\{9F8D4F16-0F61-4A38-98B3-1F6F80F11C87}\InprocServer32\1.0.0.0]
"Class"="CoreScanner.CCoreScannerClass"
"Assembly"="Interop.CoreScanner, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="file:///D:/Github/miscelaneas/COM.Scanner/libs/Interop.CoreScanner.dll"

Environment:

QUESTION

Upvotes: 3

Views: 4372

Answers (1)

Dirk Vollmar
Dirk Vollmar

Reputation: 176239

It seems that the missing component is installed together with Motorolas EMDK SDK. Installing the SDK should solve your issue.

Registering the interop assembly does not take you any further, as the interop assembly is just a library containing the type definitions of the COM component so that you are able to compile your C# code with static typing and early binding. The actual thing that needs to be registered is the underlying COM component. To register that you would use regasm.exe only if the actual COM component if the COM component was written in .NET. Otherwise you need to use the classic regsvr32.exe (or use the installer of the component vendor).

Upvotes: 3

Related Questions