TFS continuous build gives : error MSB3073 and exited with code 2

Mar 10, 2008 at 3:19 PM
I am, integrating "Sandcastle Document Generation" in my TFS Continuous Integration for a solution. It has a number of projects. And at the end, after each one gets build, I have to generate the API documentation, using SHFB. For this I have created a fake project, that is going to be built at the last. As a pre-compile step I have added following script, so that my API documentation should get fired. The command is as follows.

SandcastleBuilderConsole ..\Source\Documentation\FakeForDocumentation\ABC_API.shfb -assembly=.\XYZ*.dll

On the BUILD machine, when I run this command from visual studio it runs "ok" and generats my API Documents. But when it gets automatically build, (that is when, MSBuild) comes int the picture, the API document does not get generated and the build log shows me following error.

C:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(885,9): error MSB3073: The command "SandcastleBuilderConsole ..\Source\Documentation\FakeForDocumentation\ABC_API.shfb -assembly=.\XYZ*.dll" exited with code 2.

Anyone can please help me?
Mar 10, 2008 at 4:16 PM
A return code of 2 means there was a problem parsing the command line options. It either didn't find the project or didn't find any assemblies. The actual error is written to the console so if the build output is logged somewhere, look there for the command line error that occurred.

Mar 12, 2008 at 7:05 AM
By making following changes, I am able to automate "SandCastle" help file generation in my Continuous Integration. But at the end, my build gets failed and I am getting error MSB3073 and the build exited with CODE 3. This is surprising as my "help files" are generated properly and I expect my build to be completed successfully.

Now, my script for the same looks like this.
SandcastleBuilderConsole $(MSBuildProjectDirectory)\ABC_API.shfb -assembly=$(OutDir)XYZ*.dll
Mar 12, 2008 at 3:00 PM
Check the build log carefully and any other output log the build generates unrelated to the SHFB build. A return code of 3 from SHFB means that a project failed to build. There are cases where the help file is built but the help compiler generates a fatal error. If it's a Help 2 build, search the SHFB build log for "HXC" to find the error codes.

Mar 14, 2008 at 2:44 PM
Edited Mar 14, 2008 at 2:46 PM

Thank you Eric,

There was a fatal error related to Help 2 Build. It prompted to re-install Help 2.0 compiler. According to the same, I had re-installed Visual Studio 2008 SDK September 2007 version. It didnt work. It prompted me the same error. Then I un-installed it and installed the latest March 2008 Version. I get the same fatal error.

Can you please comment on the same?
Mar 14, 2008 at 3:31 PM
Edited Mar 15, 2008 at 1:57 AM
I believe there were some issues with the way some of the latest SDKs installed the Help 2 compiler but I don't recall the details. If I can find them, I'll post them here.

EDIT: This is the reference I was referring to:

Also note that the Help 2 stuff may be in a new location in the VS 2008 SDK (C:\Program Files\Common Files\Microsoft Shared\Help 2.0 Compiler).

Mar 17, 2008 at 5:28 AM
Thank you Eric,

The latest release of VS 2008 SDK, seems to have the same issue too. Is there any solution to this? Meanwhile, I'll check whether there is any post on the same.
Mar 22, 2008 at 6:17 AM
If you're getting an HHC6003 error, see as it contains a fix. Someone else reported this problem and this was the solution.