Class not registered Error

Running the application from Visual Studio 2012 on 64-bit computers displays the following error message:

Fetching the factory COM class for a component with CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

I am using the Inventor packandgo dll library in visualstudio.

Does anyone know what an error is?

+11
64bit dll 32-bit visual-studio-2012 com
source share
9 answers

My problem and solution

  • I have a 32-bit third-party dll that I installed on a R2 R2 machine with a 64-bit version.

  • I have a wcf service created in the .net 4.5 framework that calls a 32-bit third-party DLL for a process. Now I have a build property configured on any processor and deployed on a 64-bit machine.

  • When Ii tried to call the error caused by the wcf service, "80040154 The class is not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)

  • Now, Ii used ProcMon.exe to track the com registry problem and determined that the process is looking for a registry entry in HKLM \ CLSID and HKCR \ CLSID, where there is no entry.

  • It's time to find out that Microsoft will not register 32-bit com components on the HKLM \ CLSID, HKCR \ CLSID path on a 64-bit machine, but puts the record in the HKLM \ Wow6432Node \ CLSID and HKCR \ Wow6432Node \ CLSID path.

  • Now the conflict is a 64-bit process that is trying to invoke a 32-bit process on a 64-bit machine that will look for a registry entry in HKLM \ CLSID, HKCR \ CLSID. The solution is that we need to force the 64-bit process to look at the registry entry in HKLM \ Wow6432Node \ CLSID and HKCR \ Wow6432Node \ CLSID.

  • This can be achieved by configuring the wcf service project properties to install on "X86" instead of "Any".

  • After deploying the "X86" version on Server 2008 R2, the problem "System.BadImageFormatException: Failed to load file or assembly"

  • The solution for this badimageformatexception sets “Enable32bitApplications” to “True” in the IIS Apppool properties for the correct application.

+25
source share

The problem is that the DLL is registered in the 32-bit version of the Windows registry and the application uses the 64-bit version.

Decision. Go to the tab "Project Properties", "Compile" and click "Advanced compilation options ...". Change the "Target CPU" to x86, click "OK", save and try again.

Source: http://www.theogray.com/blog/2009/10/comexception-regdbeclassnotreg-on-64-bit-windows

Worked for me with a VB 6 COM DLL called from a .NET Net Winforms application

+5
source share

Somewhere in the code you use, there is a call to the Win32 API, CoCreateInstance , to dynamically load the DLL and instantiate the object from it.

The mapping between a component identifier and a DLL that can instantiate this object is usually located in HEKY_CLASSES_ROOT \ CLSID in the registry. To discuss this further would explain a lot about COM in Windows . But the error indicates that the COM manual is not in the registry.

I don’t really understand what the PackAndGo DLL (Autodesk component) is, but I suspect that you just need to “install” this component or the software package with which it came through the designated installer to have this DLL and the corresponding COM registry keys on your computer on which you are trying to run your code. (i.e. run setup.exe for this product).

In other words, I think you need to install "Pack and Go" on this computer, and not just copy the DLL to the target machine.

Also, make sure that you decide to create your own code suitable as 32-bit or 64-bit, depending on which layout builder (32 or 64 bit) of the Pack And Go package you are installing.

+4
source share

On 64-bit Windows machines, COM components must register in HKEY_CLASSES_ROOT \ CLSID (64-bit component) OR HKEY_CLASSES_ROOT \ Wow6432Node \ CLSID (32-bit component). If your application is a 32-bit application running on a 64-bit machine, the COM library usually looks for a GUID under the Wow64 node, and if your application is a 64-bit application, the COM library will try to load from HKEY_CLASSES_ROOT \ CLSID. Make sure you target the correct platform and make sure you install the correct version of the library (32/64 bit).

+1
source share

I decided for a long time, I'm sure, but it can help another bad soul.

This error can occur if the DLL that you deploy in the installation package does not match the DLL that you are referencing (they will have different identifiers)

It sounds obvious, but it can easily happen if you make a small change to the dll and have previously installed the application on your own machine, which will reregister the dll.

+1
source share

I had this problem, and I solved it when I realized that I was looking for the Windows registry indicated in parentheses.

Since the error occurred on only one computer, I had to export the registry from the computer on which it was running, and install it on a computer that was missing.

0
source share

I got the error below in my 32-bit application.

Error: getting COM class factory for component with CLSID {4911BB26-11EE-4182-B66C-64DF2FA6502D} failed due to the following error: 80040154 Class not registered (exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

And setting " Enable32bitApplications " to true in defaultapplicationpool in IIS worked for me.

0
source share

I have the same problem. I tried many ways, but in the end the solution was simple. Decision. Open IIS. In the application pool, right-click the .net platform you are using. Go to settings and change "Enable 32-bit applications" to "True."

0
source share

I ran into the same problem. I added a link to the dll of the COM component of Microsoft.Office.Interop.Excel, but Office was not installed on my system, this will not give a compile-time error. I moved my application to another system and launched it .. it worked successfully.

Thus, I can say that in my case it was the system environment that caused this problem.

0
source share

All Articles