类未注册错误 [英] Class not registered Error

查看:32
本文介绍了类未注册错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 64 位计算机上从 Visual Studio 2012 运行应用程序,显示以下错误消息:

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

检索具有 CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B} 的组件的 COM 类工厂由于以下错误而失败:80040154 类未注册(来自 HRESULT 的异常:0x80040154 (REGDBREA1-46FF-A83B-A270C92DAE4B))

Retrieving the COM class factory for 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))

我在 Visualstudio 中使用 Inventor packandgo dll 库.

I am using Inventor packandgo dll library in visualstudio.

有人知道错误是什么吗?

Anyone know what is the error?

推荐答案

我的问题和解决方案

  1. 我有一个 32 位的第三方 dll,我安装在 64 位的 2008 R2 机器上.

  1. I have a 32 bit third party dll which I have installed in 2008 R2 machine which is 64 bit.

我有一个在 .net 4.5 框架中创建的 wcf 服务,它调用 32 位第三方 dll 进行处理.现在我已将构建属性设置为针对任何"cpu 并将其部署到 64 位机器.

I have a wcf service created in .net 4.5 framework which calls the 32 bit third party dll for process. Now I have build property set to target 'any' cpu and deployed it to the 64 bit machine.

当我尝试调用 wcf 服务时出现错误80040154 类未注册(来自 HRESULT 的异常:0x80040154 (REGDB_E_CLASSNOTREG")

When Ii tried to invoke the wcf service got error "80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG"

现在 Ii 使用 ProcMon.exe 来跟踪 com 注册表问题,并确定该进程正在寻找 HKLMCLSID 和 HKCRCLSID 中没有条目的注册表条目.

Now Ii used ProcMon.exe to trace the com registry issue and identified that the process is looking for the registry entry at HKLMCLSID and HKCRCLSID where there is no entry.

了解到 Microsoft 不会将 32 位 com 组件注册到 64 位机器中的路径 HKLMCLSID、HKCRCLSID 而是将条目放在 HKLMWow6432NodeCLSID 和 HKCRWow6432NodeCLSID路径.

Came to know that Microsoft will not register the 32 bit com components to the paths HKLMCLSID, HKCRCLSID in 64 bit machine rather it places the entry in HKLMWow6432NodeCLSID and HKCRWow6432NodeCLSID paths.

现在冲突是 64 位进程试图调用 64 位机器中的 32 位进程,它将在 HKLMCLSID、HKCRCLSID 中查找注册表项.解决方案是我们必须强制 64 位进程查看 HKLMWow6432NodeCLSID 和 HKCRWow6432NodeCLSID 处的注册表项.

Now the conflict is 64 bit process trying to invoke 32 bit process in 64 bit machine which will look for the registry entry in HKLMCLSID, HKCRCLSID. The solution is we have to force the 64 bit process to look at the registry entry at HKLMWow6432NodeCLSID and HKCRWow6432NodeCLSID.

这可以通过将 wcf 服务项目属性配置为定位到X86"机器而不是Any"来实现.

This can be achieved by configuring the wcf service project properties to target to 'X86' machine instead of 'Any'.

将X86"版本部署到 2008 R2 服务器后出现问题System.BadImageFormatException:无法加载文件或程序集"

After deploying the 'X86' version to the 2008 R2 server got the issue "System.BadImageFormatException: Could not load file or assembly"

解决此 badimageformat 异常的方法是将 IIS Apppool 属性中的Enable32bitApplications"设置为True"以获取正确的应用程序池.

Solution to this badimageformatexception is setting the 'Enable32bitApplications' to 'True' in IIS Apppool properties for the right apppool.

这篇关于类未注册错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆