0x80040154 的 COMException 总是“类未注册"吗? [英] Is a COMException of 0x80040154 always 'Class not registered'?

查看:28
本文介绍了0x80040154 的 COMException 总是“类未注册"吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

0x80040154 的 System.Runtime.InteropServices.COMException 是否总是意味着该类未注册?我收到一个 COMException,它说由于以下错误,检索具有 CLSID {29131539-2EED-1069-BF5D-00DD011186B7} 的组件的 COM 类工厂失败:80040154."它正在尝试加载 Interop.Domino.dll,这是我从名为Lotus Domino 对象"的添加引用的 COM 选项卡中获得的引用,该引用指向 Notes 程序文件夹中的 domobj.tlb.

Does a System.Runtime.InteropServices.COMException of 0x80040154 always mean that the class isn't registered? I'm getting a COMException which says "Retrieving the COM class factory for component with CLSID {29131539-2EED-1069-BF5D-00DD011186B7} failed due to the following error: 80040154." It's trying to load Interop.Domino.dll which is a reference I got from the COM tab of Add Reference called "Lotus Domino Objects" which points to domobj.tlb in the Notes program folder.

我多年前编写了代码 - 这是我使用互操作做过的唯一一件事,可以说我从来没有真正掌握过它.

I wrote the code years ago - it's the only thing I've ever done with interop and it's fair to say that I never really got to grips with it.

在将代码移动到 2008 R2 服务器(因此它是 x64)后,我再次看到此错误.它是在 XP 上编写并在 2003 上运行(都是 x86).为了诊断问题,我构建了一个 Win7 x86(因为没有 R2 x86)框并且它工作正常.我还构建了一个 2003 x64 框,但它失败并出现相同的错误,因此看起来是由于迁移到 x64 架构引起的.在执行互操作以使 x86 COM DLL 在 x64 机器上工作时,我应该做些什么?

I'm seeing this error again after moving the code to a 2008 R2 server (so it's x64). It was written on XP and run on 2003 (both x86). In order to diagnose the problem, I built a Win7 x86 (because there's no R2 x86) box and it worked. I also built a 2003 x64 box and it fails with the same error, so it looks like it's caused by moving to x64 architecture. Is there something I should do when doing interop to get x86 COM DLLs to work on x64 machines?

推荐答案

我在尝试在 Windows 7 x64 上构建和运行名为 interop.domino.dll(仅限 32 位)的 .NET 应用程序时遇到了同样的问题.

I had the same problem trying to build and run a .NET application on Windows 7 x64 that called interop.domino.dll, which is 32 bit only.

为了解决这个问题,我重新编译了 .NET 应用程序,以便在 x64 操作系统上运行时专门作为 x86 运行.

To resolve, I recompiled the .NET application to run specifically as x86 when run on x64 operating systems.

我使用的是 Visual Studio 2010 Express Edition,与付费版本相比,它更难以专门针对 x86 平台.

I was using Visual Studio 2010 Express Edition which is trickier to target specifically for x86 platforms than the paid for versions.

解决方案是:

  1. 点击工具 > 选项 > 项目和解决方案
  2. 选中显示高级构建配置"框,然后单击确定"
  3. 点击工具>设置>检查专家设置以查看构建配置管理器
  4. 点击 BUILD > CONFIGURATION MANAGER 选择平台下拉菜单到 X86 并点击 CLOSE
  5. 现在重建项目

这篇关于0x80040154 的 COMException 总是“类未注册"吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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