Unable to generate HTML Help2.x when build is start by a service

Topics: User Forum
Jul 24, 2009 at 8:50 AM
Hi,

I have an realy special Problem.
We have an automated build server (CruiseControl.Net) that is running as a service. But I belive the problem occurs with every service not just CruiseControl.NET.
During the build an msbuild skript is called that checks out the shfbproj-File and updated the buildnumber and after that calling the shfbproj File.
When Running from the Commandline (the Skript or CruiseControl.Net application) with the same user the service is running with, all is working fine.

In the Eventlog there is a good hint to the Problem.
--------------EventLog-----------------
The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID
{314111B4-A502-11D2-BBCA-00C04F8EC294}
 to the user WKOE\ccadmin SID (S-1-5-21-3003273517-2859311309-448139102-5507).  This security permission can be modified using the Component Services administrative tool.

Since I've run in the same problem with an other service before I searched in the registry and see that this is "Hxcomp.HxComp.1" that is connected with the AppID {7BA6721B-F938-11D2-B98D-00C04F79F7FB}
which is the hxcsrv. So I went to the Component Sercies and under Component Services > Computer > My Computer >DCOM Config I searched for the 2 Id's Hxcomp.HxComp.1 is not present but hxcsrv is so I gave the user that is running the sercvice Local Activation permissin.
Now there is no error in the events anymore but still the script is not working.

-------------Skript------------
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="CallSandcastle" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>
    <Target Name="CallSandcastle">
        <Exec Command='cleartool.exe setactivity -nc -view "$(clearCaseViewName)" $(clearQuestTicket)' Condition="'$(clearQuestTicket)'!=''"/>
        <Exec Command='cleartool.exe checkout -c "Update Sandcastle-File for $(CCNetProject)" "$(CCNetWorkingDirectory)\$(scProject)"' Condition="'$(clearQuestTicket)'!=''"/>
        <RegexReplace Input="$(CCNetLabel)" Expression="$(removePart)" Replacement="" Count="1">
            <Output ItemName="VersionNumber" TaskParameter="Output" />
        </RegexReplace>
        <FileUpdate Files="$(CCNetWorkingDirectory)\$(scProject)" Regex="&lt;HelpFileVersion&gt;.*&lt;/HelpFileVersion&gt;" ReplacementText="&lt;HelpFileVersion&gt;@(VersionNumber)&lt;/HelpFileVersion&gt;" />
        <Exec Command='cleartool.exe checkin -c "Update Sandcastle-File for $(CCNetProject)" -identical "$(CCNetWorkingDirectory)\$(scProject)"' Condition="'$(clearQuestTicket)'!=''"/>
        <MSBuild Projects="$(CCNetWorkingDirectory)\$(scProject)"/>
    </Target>
</Project>

The output of the Skript is:
----------Script Output-------------
<msbuild startTime="07/24/2009 09:13:19" elapsedTime="00:00:38" success="false">
<project file="C:\Program Files\CruiseControl.NET\server\customBuildHelper\CallSandcastle.xml" success="false">
<target name="CallSandcastle" success="false">
<message level="high"><![CDATA[cleartool.exe setactivity -nc -view "buildserver_view" T00121]]></message>
<message level="high"><![CDATA[Set activity "T00121" in view "buildserver_view".]]></message>
<message level="high"><![CDATA[cleartool.exe checkout -c "Update Sandcastle-File for Nighlybuild" "D:\CC Builds\ProjectNightly\WorkingDirectory\Inhouse.shfbproj"]]></message>
<message level="high"><![CDATA[Checked out "D:\CC Builds\ProjectNightly\WorkingDirectory\Inhouse.shfbproj" from version "\main\Project_Build\12".]]></message>
<message level="high"><![CDATA[ Attached activity:]]></message>
<message level="high"><![CDATA[ activity:T00121@\InhouseWKOIT "Buildserver Nightlybuild"]]></message>
<message level="normal"><![CDATA[Updating File "D:\CC Builds\ProjectNightly\WorkingDirectory\Inhouse.shfbproj".]]></message>
<message level="normal"><![CDATA[ Replaced matches with "<HelpFileVersion>4.1.1.113</HelpFileVersion>".]]></message>
<message level="high"><![CDATA[cleartool.exe checkin -c "Update Sandcastle-File for Nighlybuil" -identical "D:\CC Builds\ProjectNigtly\WorkingDirectory\Inhouse.shfbproj"]]></message>
<message level="high"><![CDATA[Loading "Inhouse.shfbproj" (4252 bytes).]]></message>
<message level="high"><![CDATA[Checked in "D:\CC Builds\ProjectNightly\WorkingDirectory\" version "\main\Project_Build\13".]]></message>
<message level="high"><![CDATA[ Attached activity:]]></message>
<message level="high"><![CDATA[ activity:T00121@\InhouseWKOIT "Buildserver Nightlybuild"]]></message>
<project file="D:\CC Builds\GrundumlagenNightly\WorkingDirectory\Grundumlagen\Grundumlagen\Inhouse.shfbproj" success="false">
<target name="CoreBuildHelp" success="false">
<message level="normal"><![CDATA[Building D:\CC Builds\ProjectNightly\WorkingDirectory\Inhouse.shfbproj]]></message>
<message level="normal"><![CDATA[Initializing]]></message>
<message level="normal"><![CDATA[ClearWorkFolder]]></message>
<message level="normal"><![CDATA[FindingTools]]></message>
<message level="normal"><![CDATA[ValidatingDocumentationSources]]></message>
<message level="normal"><![CDATA[GenerateSharedContent]]></message>
<warning code="BE0003" file="SHFB"><![CDATA[Sandcastle shared content for the 'de-DE, German (Germany)' language could not be found. Using 'en-US, English (US)' defaults.]]></warning>
<message level="normal"><![CDATA[GenerateApiFilter]]></message>
<message level="normal"><![CDATA[GenerateReflectionInfo]]></message>
<message level="normal"><![CDATA[GenerateNamespaceSummaries]]></message>
<message level="normal"><![CDATA[ApplyVisibilityProperties]]></message>
<message level="normal"><![CDATA[TransformReflectionInfo]]></message>
<message level="normal"><![CDATA[ModifyHelpTopicFilenames]]></message>
<message level="normal"><![CDATA[CopyStandardContent]]></message>
<message level="normal"><![CDATA[CopyAdditionalContent]]></message>
<message level="normal"><![CDATA[MergeTablesOfContents]]></message>
<message level="normal"><![CDATA[CreateBuildAssemblerConfigs]]></message>
<message level="normal"><![CDATA[MergeCustomConfigs]]></message>
<message level="normal"><![CDATA[BuildReferenceTopics]]></message>
<message level="normal"><![CDATA[GenerateIntermediateTableOfContents]]></message>
<message level="normal"><![CDATA[GenerateHelpFormatTableOfContents]]></message>
<message level="normal"><![CDATA[UpdateTableOfContents]]></message>
<message level="normal"><![CDATA[GenerateHelpProject]]></message>
<message level="normal"><![CDATA[CompilingHelpFile]]></message>
<error code="BE0043" file="SHFB"><![CDATA[Unexpected error detected in last build step. See output above for details.]]></error>
<message level="normal"><![CDATA[Failed]]></message>
<message level="normal"><![CDATA[Build details can be found in D:\CC Builds\ProjectNightly\WorkingDirectory\Help\Logfile.log]]></message>
</target>
</project>
</target>
</project>

The Last Messages from the Logfile are:
------------Tail of Logfile----------------
<buildStep step="GenerateHelpProject">
Generating HTML Help 2.x project files...
    Last step completed in 00:00:00.0303
</buildStep>
<buildStep step="CompilingHelpFile">
Compiling HTML Help 2.x file...
[c:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe]
D:\CC Builds\GrundumlagenNightly\WorkingDirectory\Grundumlagen\Grundumlagen\Help\Working\Build2xHelpFile.proj(62,5): error MSB6006: &quot;HXCOMP.EXE&quot; exited with code 3.
    Last step completed in 00:00:00.5612
</buildStep>
<buildStep step="Failed">

SHFB: Error BE0043: Unexpected error detected in last build step.  See output above for details.

</buildStep>
</shfbBuild>
Has anyone any idea?

Regards,
Michael
Jul 24, 2009 at 8:53 AM

Sorry I forgot something

The System is:

Microsoft Windows Server 2003 R2

Standard Edtione

Service Pack 2

Jul 27, 2009 at 10:37 AM

Yes, I can confirm that this also happens when trying to build remotely through cygwin SSH - strangely enough, on another build machine, it works without a hitch (I'm using an older version of SSHD there, so

this might well be the reason). Since we don't have to build the documentation very often, I just build it only when necessary on a local account. Nevertheless, I'd like a proper solution for this, too...