初始化 VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll) 时出现错误 80040154(类未注册异常) [英] Error 80040154 (Class not registered exception) when initializing VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll)

查看:19
本文介绍了初始化 VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll) 时出现错误 80040154(类未注册异常)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试运行这个工具以便转换生成文件的 Visual C++ 项目.我试图转换项目的项目是用 VS2008 编写的,所以我使用了版本 9 中对 Microsoft.VisualStudio.VCProjectEngine.dll 的引用.

I'm trying to run this tool in order to convert a Visual C++ project to makefile. The project I'm trying to convert project is written in VS2008, so I'm using a reference to Microsoft.VisualStudio.VCProjectEngine.dll from version 9.

它在这一行失败了:

VCProjectEngine vcprojEngine = new VCProjectEngineObject();

以下情况除外:

检索 COM 类工厂带有 CLSID 的组件{D19A00C4-A7F9-4E14-A5E1-D060B7EB57F3}由于以下错误而失败:80040154 类未注册(来自 HRESULT 的异常:0x80040154(REGDB_E_CLASSNOTREG)).

Retrieving the COM class factory for component with CLSID {D19A00C4-A7F9-4E14-A5E1-D060B7EB57F3} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

当我尝试使用 regsvr32 注册 VCProjectEngine.dll 时,我收到一个错误,提示找不到入口点 DllRegisterServer.

When tried to register VCProjectEngine.dll with regsvr32, I got an error that the entry point DllRegisterServer was not found.

有什么想法吗??

提前致谢.

推荐答案

失败的原因并不多,尤其是 regsvr32 步骤.在该 dll 上运行 dumpbin/exports.如果您没有看到 DllRegisterServer,那么您的安装已损坏.它应该有更多的副作用,您将无法再构建 C/C++ 项目.

There are not many good reasons this would fail, especially the regsvr32 step. Run dumpbin /exports on that dll. If you don't see DllRegisterServer then you've got a corrupt install. It should have more side-effects, you wouldn't be able to build C/C++ projects anymore.

一种标准故障模式是在 64 位操作系统上运行它.这是 32 位非托管代码,您确实会收到类未注册"异常.项目 + 属性,构建选项卡,将平台目标更改为 x86.

One standard failure mode is running this on a 64-bit operating system. This is 32-bit unmanaged code, you would indeed get the 'class not registered' exception. Project + Properties, Build tab, change Platform Target to x86.

这篇关于初始化 VCProjectEngineObject (Microsoft.VisualStudio.VCProjectEngine.dll) 时出现错误 80040154(类未注册异常)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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