1
votes

I have a rather large solution, which contains two documentation projects based on Sandcastle + Sandcastle Help File Builder (SHFB). These projects both build correctly from the command line (msbuild project.shfb) and also using the beta version of SHFB Visual Studio 2010 integration.

When I run the build in TeamCity though, I get a mysterious build failure within the documentation build. The SHFB log says this:

      [Sandcastle Help File Builder, version 1.9.3.0]
      Cached Resolve Reference  Links 2 Component.  Copyright © 2006-2011, Eric Woodruff, All Rights Reserved
      http://SHFB.CodePlex.com
  Info: CachedResolveReferenceLinksComponent: Loaded 61 cached MSDN URL entries
  Info: SaveComponent: Instantiating component.
  Info: BuildAssembler: Building topic N:MyProject
  Info: BuildAssembler: Building topic T:MyProject.ActionNotImplementedException
  Info: BuildAssembler: Building topic AllMembers.T:MyProject.ActionNotImplementedException
  Info: BuildAssembler: Building topic Methods.T:MyProject.ActionNotImplementedException
  Info: BuildAssembler: Building topic Properties.T:MyProject.ActionNotImplementedException
  Info: BuildAssembler: Building topic Overload:MyProject.ActionNotImplementedException.#ctor
  Info: BuildAssembler: Building topic M:MyProject.ActionNotImplementedException.#ctor
  Info: BuildAssembler: Building topic M:MyProject.ActionNotImplementedException.#ctor(System.String)
BUILDASSEMBLER : error : CachedCopyFromIndexComponent: An access error occured while attempting to load the file 'C:\Program Files (x86)\Sandcastle\Data\Reflection\mscorlib.xml'. The error message is: Could not find file 'C:\Program Files (x86)\Sandcastle\Data\Reflection\mscorlib.xml'. [C:\BuildAgent\work\37c2302839b8996f\Help\Output\Developer\Working\BuildReferenceTopics.proj]
    Last step completed in 00:02:31.3827
</buildStep>
<buildStep step="Failed">  

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

</buildStep>
</shfbBuild>

Sure enough, the file that Sandcastle is looking for (mscorlib.xml) is not there. But the build works outside of TeamCity, so I would conclude that Sandcastle is only looking for that file when TeamCity is onvolved. So, why does this only cause a failure in TeamCity and not from the command line within msbuild? I'd appreciate any troubleshooting hints because I'm out of inspiration.

Clarification (thanks @Sayed): The TeamCity build agent is the same computer where I can successfulyl run the command line build, so it's the same computer for everything mentioned above. The TeamCity Server is a different computer but that takes no part in the build.

1
"But the build works outside of TeamCity, so I would conclude that Sandcastle is only looking for that file when TeamCity is onvolved." By that you mean that it works on the same machine that Team City is using?Sayed Ibrahim Hashimi
@Sayed - yes, sorry I should have mentioned that. The TeamCity build agent is the same computer where the manual build works correctly. I will update the question to reflect this.Tim Long
OK thats interesting. When you invoke msbuild.exe on the command line you can pass /fl to create a log, you should examine that against the TC log to see what is happening different. If you dont figure it out u can send me the logs and I can look. Just ping me on twitter SayedIHashimi.Sayed Ibrahim Hashimi
I have the same issue using SHFB (exact same error involving mscorlib.xml)... did you find a solution?Thomas Levesque
BTW, it works if I disable the "Cached Reflection Index Data" component... since this component is not strictly necessary (it's just an optimisation to decrease the build time), it's an acceptable solution until I find the cause of the problem.Thomas Levesque

1 Answers

5
votes

I hit the same problem today, and I eventually managed to solve it: you just need to delete the cache files in the %USERPROFILE%\AppData\Local\EWSoftware\Sandcastle Help File Builder\Cache folder.

(note: since your problem is related to TeamCity, perhaps the files are in the TeamCity data folder instead)

In my case, I think it's because the cache files had been generated with an older version of SHFB, and were not compatible with the new version.