windows 类未注册 HRESULT 0x80040154

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/431455/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 11:48:29  来源:igfitidea点击:

Class not registered HRESULT 0x80040154

windowswindows-vista

提问by user53729

I'm using the .NET framework version 6.0 on Windows Vista. I recently installed a program that displays charts. When I open it, I get an error message from the Microsoft .NET framework:

我在 Windows Vista 上使用 .NET 框架 6.0 版。我最近安装了一个显示图表的程序。当我打开它时,我收到来自 Microsoft .NET 框架的错误消息:

Class not registered (exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

类未注册(HRESULT 的异常:0x80040154 (REGDB_E_CLASSNOTREG))。

How do I fix the problem? Thanks.

我该如何解决问题?谢谢。

回答by abelenky

The simple answer is that you register the class. (if you knew which class wasn't registered, and what library it was in.) But its a big failing of errors such as this that they don't tell you these important details.

简单的答案是您注册该课程。(如果你知道哪个类没有注册,以及它在哪个库中。)但是这样的错误是一个很大的失败,因为他们没有告诉你这些重要的细节。

I think your better option is to uninstall the software, and re-install it carefully, reading every installation panel carefully, checking for prerequisites, or any other instructions. And be sure to start the installer with "Run As Administrator".

我认为您更好的选择是卸载软件,然后仔细重新安装,仔细阅读每个安装面板,检查先决条件或任何其他说明。并确保以“以管理员身份运行”启动安装程序。

If that still fails, call tech-support for the software.

如果仍然失败,请致电该软件的技术支持。

回答by Zoltan Szilagyi

This is probably due to a missing dependency or an incorrect version of some binary. You can see managed (MSIL) dependencies by looking at assemblies' manifests using the IL Disassembler tool (ildasm.exe). To explore dependencies in the unmanaged (native) world, use the Dependency Walker tool (depends.exe). These tools variously come with the .NET Framework, Visual Studio, etc., or may be available on Microsoft's website.

这可能是由于缺少依赖项或某些二进制文件的版本不正确。您可以通过使用 IL 反汇编工具 (ildasm.exe) 查看程序集的清单来查看托管 (MSIL) 依赖项。要探索非托管(本机)世界中的依赖项,请使用 Dependency Walker 工具 (depends.exe)。这些工具随 .NET Framework、Visual Studio 等不同而不同,或者可以在 Microsoft 的网站上获得。

回答by Eugenio Miró

I think that 6.0 is the Windows version. That matches with Vista version.
However, the problem is related to COM registration. There is a class that's unregistered and probably (as abelenky pointed out) that failed on setup because that was not executed as administrator. My advice:

我认为 6.0 是 Windows 版本。这与Vista版本匹配。
但是,问题与 COM 注册有关。有一个类未注册并且可能(如 abelenky 指出的)在安装时失败,因为它不是以管理员身份执行的。我的建议:

  1. run again the setup as admin (that should ocurred automatically if the setup was named setup or install or with a name with those words) then try again
  2. if it doesn't work run the app as admin
  3. if still doesn't work try looking dependencies, here I'd use Depencency Walkeron the COM dlls the program references.
  1. 以管理员身份再次运行安装程序(如果安装程序名为 setup 或 install 或名称带有这些词,则应自动发生)然后再试一次
  2. 如果它不起作用,请以管理员身份运行该应用程序
  3. 如果仍然不起作用,请尝试查看依赖项,在这里我将在程序引用的 COM dll 上使用Depencency Walker

There is yet an unsolved problem if the program is not yours, which are those COM dlls, the program references?, well here I'd:

如果程序不是你的,还有一个未解决的问题,那些 COM dll,程序引用?,在这里我会:

  1. try to register all dlls within the program's folder
  2. if that doesn't work I'd try System32 folder sorting by creation date.
  1. 尝试在程序文件夹中注册所有 dll
  2. 如果这不起作用,我会尝试按创建日期对 System32 文件夹进行排序。

I'm thinking here in an application that's not fully supported in Vista and how to force its installation.

我正在考虑在 Vista 中不完全支持的应用程序以及如何强制安装。

Any other ideas?

还有其他想法吗?