none
VS2013 hhc custom build step error detection

    Question

  • I have a VS solution which builds compiled html help files (.chm) using a custom build step which runs the MS html help compiler hhc.exe against the .hhp project file. The solution builds successfully in VS2005, but after migrating to VS2013 many of these same projects that previously build fine suddenly start failing. Comparing the output from the two versions of VS build, the projects which are now deemed to be failing in VS2013 all throw 'HHC5013 : error : URL reference in the TOC cannot be resolved: "<blah>.htm"' errors, followed by a line reading 'The command exited with code -1.'. The same HHC5013 errors are also thrown in the VS2005 build, but are not followed with the 'The command exited with code -1.' warning and are not treated as failures by the build. I think the HHC5013 errors are actually spurious (the referenced .htm files ARE there and accessible, hhc.exe just thinks they aren't - I believe this is a known un-addressed issue in hhc.exe) the build is able to continue successfully in VS2005, but under VS2013 the spurious error prevents the project build from executing the defined 'Post-Build event' and completing correctly. Does anyone know of any way to override the project build result interpretation in a VS2013 solution, or forcing hhc.exe to ignore the HHC5013 errors or something?
    Wednesday, February 7, 2018 4:41 PM

Answers

  • I ended up having to wrap the hhc command inside a batch file with " > nul" at the end of the command like this:
    hhc %1 > nul
    It's very blunt, it means your solution build apparently always 'succeeds' whatever the actual state of your help projects, but it's the price of having to use a clearly dreadful bit of software.
    My invoice is in the post MS.
    • Marked as answer by tc46352 Thursday, February 8, 2018 4:58 PM
    Thursday, February 8, 2018 4:58 PM