1

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.

Tim Long
  • 13,508
  • 19
  • 79
  • 147
  • "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 Jan 03 '12 at 01:11
  • @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 Jan 03 '12 at 04:49
  • 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 Jan 03 '12 at 05:08
  • I have the same issue using SHFB (exact same error involving mscorlib.xml)... did you find a solution? – Thomas Levesque Jan 18 '12 at 21:53
  • 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 Jan 18 '12 at 22:10
  • @ThomasLevesque how did you disable the component? Was it helpful as a workaround? – Sam Jan 10 '18 at 15:15
  • @Sam, I don't remember, it was a long time ago... – Thomas Levesque Jan 10 '18 at 18:46

1 Answers1

5

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.

Thomas Levesque
  • 286,951
  • 70
  • 623
  • 758
  • Hmmm, my TeamCity build agent runs as LocalSystem, I can't find any EWSoftware folders anywhere though. I wonder where the LocalSystem user's AppData folder is? – Tim Long Jan 19 '12 at 01:52
  • @TimLong, on Win7 the LocalSystem user profile is in `C:\Windows\system32\config\systemprofile`; on XP it's in `C:\Documents and Settings\LocalService`. – Thomas Levesque Jan 19 '12 at 09:21
  • Thanks for all the help Thomas. Case closed. – Tim Long Jan 19 '12 at 15:53
  • I had to build using the gui (to rebuild the deleted cache files) and copy an old mscorlib.xml file (from previous install) into the reflection directory. – Blake Niemyjski Apr 24 '12 at 19:46
  • 1
    Here is a link to the issue I logged on CodePlex (http://sandcastle.codeplex.com/workitem/12067). – Blake Niemyjski Apr 24 '12 at 20:06