This project has moved and is read-only. For the latest updates, please go here.

error MSB6006: HXCOMP.EXE exited with code 2.

Topics: Developer Forum, User Forum
Apr 22, 2009 at 2:11 AM
Hi I keep getting the above error whene I try to compile a Help2 file. Here's the log excerpt:

<buildStep step="CompilingHelpFile">
Compiling HTML Help 2.x file...
C:\Documents and Settings\Administrator\My Documents\My Projects\MyCourts\bin\Debug\Help\Working\Build2xHelpFile.proj(62,5): error MSB6006: &quot;HXCOMP.EXE&quot; exited with code 2.
    Last step completed in 00:03:15.5938
<buildStep step="Failed">
SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

and the project file data is:
  <!-- Task properties -->
    <HelpCompilerFolder>C:\Program Files\Common Files\Microsoft Shared\Help 2.0 Compiler\</HelpCompilerFolder>
    <OutputFolder>C:\Documents and Settings\Administrator\My Documents\My Projects\MyCourts\bin\Debug\Help\</OutputFolder>

Any ideas where I should look now?

Apr 22, 2009 at 3:40 AM
Check back further in the log to see if there are any other failures that are occurring before that.  You might also look in the output log file created by it if it exists (MyCourtsVS2008.log) to see if there was anything reported in there.  See if you can run it from the command line.  In the build's working folder, enter this:

"C:\Program Files\Common Files\Microsoft Shared\Help 2.0 Compiler\HXCOMP.EXE" -p MyCourtsVS2008.HxC -l MyCourtsVS2008.log

The other cause could be a corrupt install of the Help 2 compiler stuff.  It probably isn't as it looks like it ran for at least 3 minutes according to the last reported step time.

Apr 22, 2009 at 4:25 AM
Hi Eric,

There are 3 errors in the log and each is a reference to over 2000 characters in the TOC. Presumably it was/is truncated OK.

I ran from the command line as you suggested and everything worked fine.

Sep 30, 2009 at 6:22 PM

I started getting the same error for Help 2.x after adding namespace level documentation using the NamespaceDoc private class technique. Looking at the log (in our case Framework.log) file, I see 33 errors all pointing to the HTML file containing all of the namespace summaries. The error message says "The value of the <title> tag for an HTML topic exceeds 1999 characters". Any thoughts?

Oct 1, 2009 at 1:16 AM

The title is usually the API member name or, in the case of the namespace summary page, a generic title.  It should give you the topic filename which can be found in the working folder so take a look at it and see what it's got for a title.  As indicated, you may also try building from the command line.



Oct 1, 2009 at 2:29 PM

Hi Eric,

I looked at the HTML file referenced in the error and the title tag is actually the partial content of the file (I've stripped off the actual namespace summaries):

<html xmlns:MSHelp=""><head><title /><link rel="stylesheet" type="text/css" href="../styles/presentation.css" /><link rel="stylesheet" type="text/css" href="ms-help://Hx/HxRuntime/HxLink.css" /><script type="text/javascript" src="../scripts/script_prototype.js"> </script><script type="text/javascript" src="../scripts/EventUtilities.js"> </script><script type="text/javascript" src="../scripts/StyleUtilities.js"> </script><script type="text/javascript" src="../scripts/SplitScreen.js"> </script><script type="text/javascript" src="../scripts/ElementCollection.js"> </script><script type="text/javascript" src="../scripts/MemberFilter.js"> </script><script type="text/javascript" src="../scripts/CollapsibleSection.js"> </script><script type="text/javascript" src="../scripts/LanguageFilter.js"> </script><script type="text/javascript" src="../scripts/CookieDataStore.js"> </script><meta name="file" content="d4648875-d41a-783b-d5f4-638df39ee413" /><xml xmlns:msxsl="urn:schemas-microsoft-com:xslt"><MSHelp:Attr Name="AssetID" Value="R:Project" /><MSHelp:Keyword Index="A" Term="R:Project" /><MSHelp:Attr Name="TopicType" Value="apiref" /><MSHelp:Attr Name="TopicType" Value="kbSyntax" /><MSHelp:Attr Name="Locale" Value="en-us" /></xml></head><body></body></html>

Oct 1, 2009 at 8:20 PM

Have you applied the Sandcastle Styles patch?  It fixes a number of issues including a few with the namespace list page.



Oct 2, 2009 at 1:43 PM

That did the trick! HTML Help 2.x compiles without a problem after installing Sancastle Syles patch for Sandcastle May 2008 release. Thanks Eric!

May 9, 2010 at 4:08 PM

>Have you applied the Sandcastle Styles patch?  It fixes a number of issues including a few with the namespace list page.

How are they to be applied ? The zip file I donwloaded from that link just contained some files.

<input id="ctl00_ctl00_MasterContent_Content_PostRepeater_ctl12_PostId" name="ctl00$ctl00$MasterContent$Content$PostRepeater$ctl12$PostId" type="hidden" value="241027" />
May 10, 2010 at 2:50 PM

You have to copy the unzipped files to the Sandcastle install directory, default is C:\Program Files\Sandcastle.

Jul 7, 2010 at 7:14 PM

I've just upgraded to the latest Sandcastle and SHFB and I'm now getting this error (although we've never seen it before). I checked the log file and I don't see any issues with title tags or number of characters.

Any ideas?

Jul 7, 2010 at 8:06 PM

I've found and fixed a couple of issues (it isn't setting the default topic ID correctly when there is no conceptual content and using a NamingMethod other than GUID fails).  Most likely it's related to one of those problems.  I'll issue an update this evening to correct the problems.



Jul 10, 2010 at 11:33 PM
Edited Jul 11, 2010 at 9:47 AM
Getting same error with latest sandcastle release (jun 2010) and shfb release ( Not much of a clue about the cause though...
Generating MS Help 2 table of contents file...
  XslTransform (v2.6.10621.1)
  Copyright ¸ Microsoft 2005-2006
  Info: Applying XSL transformation 'C:\Program Files (x86)\Sandcastle\ProductionTransforms\TocToHxSContents.xsl'.
  toc.xml -> CadLib.HxT
    Last step completed in 00:00:04.0072
Generating MS Help 2 project files...
    Last step completed in 00:00:00.1810
Compiling MS Help 2 file...
E:\wout\WorkingCopies\ww_3.5\doc\WW\Cad\Working\Build2xHelpFile.proj(62,5): error MSB6006: "HXCOMP.EXE" exited with code 2.
  Microsoft Help Compiler Version 2.07.61224.0 Copyright (c) Microsoft Corp.
Jul 11, 2010 at 2:11 AM

Try the things noted in the thread above.  Look through the log for other issues.  If you can't find anything, try installing the Sandcastle Styles patch if you haven't done so already.  If that doesn't help, try reinstalling the VS2005/VS2008 SDK to reinstall the Help 2 compiler components.



Jul 11, 2010 at 9:43 AM
Edited Jul 11, 2010 at 9:49 AM
Wasn't the styles patch was intended for the previous sandcastle version? Or haven't they included the patch in the production release yet?

Note that the previous Sandcastle/shfb version work ok when compiling Help 2, so I'm assuming my VS 2008 SDK installation is ok.

Jul 11, 2010 at 11:17 AM
Aaah, found the log file:
Microsoft Help Compiler Version 2.07.61224.0 Copyright (c) Microsoft Corp.

Info: Building output file CadLib.HxS.
Error HXC3023: File E:\wout\WorkingCopies\ww_3.5\doc\WW\Cad\Working\Output\MSHelp2\CadLib.HxT, Line 0, Char 0: Failed to open file html\CadLib.htm.
Error HXC3023: Failed to open file E:/wout/WorkingCopies/ww_3.5/doc/WW/Cad/Working/Output/MSHelp2/html/CadLib.htm.
Info: Parsing topic  2: /html/899fac18-e7dc-7a13-4146-4ce96adfaef5.htm
The message is correct, there is no html\CadLib.htm, but there is one in .\CadLib.html. This is the main topic page that is generated from a CadLib.topic file. So perhaps this html page is put in the wrong place?

On closer inspection, this project file was imported from a previous shfb version project file. And after conversion it put the CadLib.topic page in the project root, but also in folder doc\Help2\. I'm not sure if this is proper...

- Wout
Jul 11, 2010 at 11:54 AM
Aha, kicked out the .topic files, and also the sitemap file, and now it compiles again. Gonna mess with it a bit more.

- Wout
Jul 11, 2010 at 7:14 PM

The sitemap and .topic file stuff is deprecated so I haven't done much testing with it related to the changes in the current release.  There were a number of changes in how the TOC is produced to support MS Help Viewer output.  If you have the time, convert it to MAML and a content layout file.  There's an HTML to MAML converter available at the Sandcastle Styles CodePlex site that will do a lot of the work in the conversion.  Although not necessarily required to use Sandcastle, the Sandcastle Styles patch is still relevant as none of the stuff it fixes in the transformations made it into the latest Sandcastle release.