AfterBuildHelp not running

Topics: User Forum
Oct 30, 2013 at 4:08 PM
Edited Oct 30, 2013 at 4:09 PM
I am trying to create a target in my project file to copy generated files to a drop location, but it is failing to run so I created a simpler target as a test:
  <Target Name="AfterBuildHelp">
    <Message Text="AfterBuildHelp" Importance="high" />
  </Target>
This target runs intermittently. Two back-to-back builds may have different results, but it fails more often than not. Is there some condition that determines whether the AfterBuildHelp target gets invoked in the lifecycle? Because it is definitely not being run, as you can see in the log below:
1>Target "BeforeBuildHelp" in file "C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets" from project "C:\Users\amartin\Work\Test\Main\DotNet Documentation\Documentation.Core\DocumentationProject.shfbproj" (target "Build" depends on it):
1>Done building target "BeforeBuildHelp" in project "DocumentationProject.shfbproj".
1>Target "CoreBuildHelp" in file "C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\SandcastleHelpFileBuilder.targets" from project "C:\Users\amartin\Work\Test\Main\DotNet Documentation\Documentation.Core\DocumentationProject.shfbproj" (target "Build" depends on it):
1>  Using "SandcastleBuilder.Utils.MSBuild.BuildHelp" task from assembly "C:\Program Files (x86)\EWSoftware\Sandcastle Help File Builder\\SandcastleBuilder.Utils.dll".
1>  Task "SandcastleBuilder.Utils.MSBuild.BuildHelp"
1>      Task Parameter:ProjectFile=C:\Users\amartin\Work\Test\Main\DotNet Documentation\Documentation.Core\DocumentationProject.shfbproj
1>      Task Parameter:Configuration=Debug
1>      Task Parameter:Platform=AnyCPU
1>      Task Parameter:OutDir=.\
1>      Task Parameter:Verbose=False
1>      Building C:\Users\amartin\Work\Test\Main\DotNet Documentation\Documentation.Core\DocumentationProject.shfbproj
1>      Initializing
1>      ValidatingDocumentationSources
1>      GenerateSharedContent
1>      GenerateApiFilter
1>      GenerateReflectionInfo
1>      GenerateNamespaceSummaries
1>      ApplyVisibilityProperties
1>      TransformReflectionInfo
1>      CopyAdditionalContent
1>      MergeTablesOfContents
1>      GenerateIntermediateTableOfContents
1>      CreateBuildAssemblerConfigs
1>      MergeCustomConfigs
1>      BuildReferenceTopics
1>      CombiningIntermediateTocFiles
1>      CopyStandardHelpContent
1>      GenerateHelpFormatTableOfContents
1>      GenerateHelpProject
1>      CompilingHelpFile
1>      CleanIntermediates
1>      Completed
1>      The help file is located at: C:\Users\amartin\Work\Test\Main\DotNet Documentation\Documentation.Core\Release\Help\Test.mshc
========== Build: 1 succeeded, 0 failed, 6 up-to-date, 0 skipped ==========
Is there a different target I should be using that will work consistently?
Coordinator
Oct 30, 2013 at 8:04 PM
Make sure the target is at the end of the project file after the Import element that brings in the SHFB targets. As long as that's done, it should work every time. For copying files, you can also use the output deployment plug-in.

Eric
Oct 30, 2013 at 8:57 PM
I have the custom target defined below the SHFB target include. So it turns out that from MSBuild it gets invoked every time, so there is some VS weirdness going on, but that's not a problem because this needs to run in TFS and it looks like it gets invoked correctly from TFS. Thanks!

Andy