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

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

问题描述

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


检索COM类工厂组件与CLSID {F2D4F4E5-EEA1-46FF-A83B-A270C92DAE4B}失败,由于以下错误:80040154类未注册(从HRESULT异常:0x80040154(REGDB_E_CLASSNOTREG))


我在visualstudio中使用Inventor packandgo dll库。



任何人都知道错误是什么?

解决方案

我的问题和解决方案



  1. 我在.net 4.5框架中创建了一个wcf服务,它调用32位第三方dll进程。现在我有build属性设置为目标'任何'cpu并将其部署到64位机器。


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


  3. 现在,我使用ProcMon.exe来跟踪com注册表问题,并确定该进程正在HKLM \CLSID和HKCR \CLSID找到没有条目的注册表项。 / p>


  4. 知道Microsoft不会将32位元件注册到64位机器中的路径HKLM \CLSID,HKCR\CLSID,


  5. 现在冲突是64位进程试图调用32位进程的一个例子,这个进程在HKLM \Wow6432Node\CLSID和HKCR \Wow6432Node \CLSID路径中。在64位机器,它将寻找HKLM \CLSID,HKCR \CLSID中的注册表项解决方案是我们必须强制64位进程看看注册表项HKLM \Wow6432Node \CLSID和HKCR \\ \\ wow6432Node \CLSID。


  6. 这可以通过配置wcf服务项目属性来定位到'X86'机器而不是'Any' p>


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

    >
  8. 解决方案到此badimageformatexception是在适用于apppool的IIS应用程序属性中将Enable32bitApplications设置为True。



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

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))

I am using Inventor packandgo dll library in visualstudio.

Anyone know what is the error?

解决方案

My problem and the solution

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

  2. 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.

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

  4. Now Ii used ProcMon.exe to trace the com registry issue and identified that the process is looking for the registry entry at HKLM\CLSID and HKCR\CLSID where there is no entry.

  5. Came to know that Microsoft will not register the 32 bit com components to the paths HKLM\CLSID, HKCR\CLSID in 64 bit machine rather it places the entry in HKLM\Wow6432Node\CLSID and HKCR\Wow6432Node\CLSID paths.

  6. 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 HKLM\CLSID, HKCR\CLSID. The solution is we have to force the 64 bit process to look at the registry entry at HKLM\Wow6432Node\CLSID and HKCR\Wow6432Node\CLSID.

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

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

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

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

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