构建视觉工作室的步骤根本没有被调用

时间:2021-04-11 08:19:01

The long of it is I built an installer in visual studio that gave me this cheery error when I tried to use the program:

很长一段时间我在visual studio中构建了一个安装程序,当我尝试使用该程序时,它给了我这个愉快的错误:

Retrieving the COM class factory for component with CLSID {EC10E7E8-797E-4495-A86D-3E9EADA6D5BB} failed due to the following error: 80040154.

由于以下错误,检索具有CLSID {EC10E7E8-797E-4495-A86D-3E9EADA6D5BB}的组件的COM类工厂失败:80040154。

From that it seems I need to embed the manifest in the executable and to do that I should add as a post build event the following:

从那看起来我似乎需要将清单嵌入可执行文件中,为此我应该添加为后期构建事件:

"$(DevEnvDir)....\VC\bin\mt.exe" -manifest "$(ProjectDir)$(TargetName).exe.manifest" –outputresource:"$(TargetDir)$(TargetFileName)";#1

“$(DevEnvDir).... \ VC \ bin \ mt.exe”-manifest“$(ProjectDir)$(TargetName).exe.manifest”-outputresource:“$(TargetDir)$(TargetFileName)”;#1

Well, when I do that and build the solution the event is not being called at all. In fact, I can put any old random text in the pre and post events and no error is ever given nor do I see anything being called.

好吧,当我这样做并构建解决方案时,事件根本就没有被调用。事实上,我可以在事件前和事件后放置任何旧的随机文本,并且不会给出任何错误,也不会看到任何被调用的内容。

Is there something that I should be doing differently to make this work?

有什么东西我应该采取不同的方式来使这项工作?

Additional information:

I'm building from the IDE. And when I toggle the build types to debug and release I still the correct command in the post build events.

我正在从IDE构建。当我将构建类型切换为调试和释放时,我仍然在后期构建事件中使用正确的命令。

Is there a way to see a log of what it's doing?

有没有办法看到它正在做什么的日志?

3 个解决方案

#1


1  

Tool + Options, Project and Solutions, Build and Run, set "MSBuild project build output verbosity" to Detailed. You'll get a ton of diagnostics in the Output window.

工具+选项,项目和解决方案,构建和运行,将“MSBuild项目构建输出详细程度”设置为详细。您将在“输出”窗口中获得大量诊断信息。

FWIW, the error message you get is a simple "class not registered" error. Fix with Regsvr32.exe

FWIW,您收到的错误消息是一个简单的“类未注册”错误。使用Regsvr32.exe进行修复

#2


0  

two guesses:

  • build is not succeeding
  • 构建没有成功

  • your post/pre build events are defined in a project config that is not being built, like you define your events in the "debug" build but are building the "release" build.
  • 您的发布/预构建事件是在未构建的项目配置中定义的,就像您在“debug”构建中定义事件但正在构建“发布”构建一样。

are you building the solution from the command line or anything like that?

你是从命令行或类似的东西构建解决方案?

#3


0  

Here's what worked. You apparently don't need to bake the manifest into the program. It was enough to include the manifest into the msi package and also include the DLL that the dependency checker missed.

这是有效的。您显然不需要将清单烘焙到程序中。将清单包含在msi包中并且还包括依赖性检查器错过的DLL就足够了。

Like most things so simple once you know :-)

一旦你知道,就像大多数事情一样简单:-)

Why the post build steps aren't being called I don't know, but the real problem is solved.

为什么没有调用post构建步骤我不知道,但真正的问题已经解决了。

#1


1  

Tool + Options, Project and Solutions, Build and Run, set "MSBuild project build output verbosity" to Detailed. You'll get a ton of diagnostics in the Output window.

工具+选项,项目和解决方案,构建和运行,将“MSBuild项目构建输出详细程度”设置为详细。您将在“输出”窗口中获得大量诊断信息。

FWIW, the error message you get is a simple "class not registered" error. Fix with Regsvr32.exe

FWIW,您收到的错误消息是一个简单的“类未注册”错误。使用Regsvr32.exe进行修复

#2


0  

two guesses:

  • build is not succeeding
  • 构建没有成功

  • your post/pre build events are defined in a project config that is not being built, like you define your events in the "debug" build but are building the "release" build.
  • 您的发布/预构建事件是在未构建的项目配置中定义的,就像您在“debug”构建中定义事件但正在构建“发布”构建一样。

are you building the solution from the command line or anything like that?

你是从命令行或类似的东西构建解决方案?

#3


0  

Here's what worked. You apparently don't need to bake the manifest into the program. It was enough to include the manifest into the msi package and also include the DLL that the dependency checker missed.

这是有效的。您显然不需要将清单烘焙到程序中。将清单包含在msi包中并且还包括依赖性检查器错过的DLL就足够了。

Like most things so simple once you know :-)

一旦你知道,就像大多数事情一样简单:-)

Why the post build steps aren't being called I don't know, but the real problem is solved.

为什么没有调用post构建步骤我不知道,但真正的问题已经解决了。