简体   繁体   中英

Post build visual studio step not being called at all

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:

Retrieving the COM class factory for component with CLSID {EC10E7E8-797E-4495-A86D-3E9EADA6D5BB} failed due to the following error: 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

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.

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

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.

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

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.

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM