2012-01-02 57 views
1

我有一个相当大的解决方案,它包含两个基于Sandcastle + Sandcastle帮助文件生成器(SHFB)的文档项目。这些项目都可以从命令行(msbuild project.shfb)正确构建,也可以使用SHFB Visual Studio 2010集成的测试版。神秘失败的沙堡仅在TeamCity构建时才生成

虽然我在TeamCity中运行构建,但在文档构建中出现了一个神秘的构建失败。该SHFB日志这样说:

  [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>

果然,那沙堡正在寻找(mscorlib.xml)的文件不存在。但是这个构建在TeamCity之外工作,所以我会得出结论,Sandcastle只有在TeamCity被引用时才会看到的10。那么,为什么这只会导致TeamCity失败,而不是从msbuild中的命令行中导致失败?我会很感激任何故障排除提示,因为我没有灵感。 (感谢@Sayed):TeamCity构建代理是我可以成功运行命令行构建的同一台计算机,因此它是上述所有内容的同一台计算机。 TeamCity服务器是不同的计算机,但不参与构建。

+0

“但是这个构建在TeamCity之外工作,所以我会得出结论Sandcastle只在TeamCity进行时才会查找该文件。”那么你的意思是它可以在Team City使用的同一台机器上运行? – 2012-01-03 01:11:42

+0

@Sayed - 是的,抱歉,我应该提到这一点。 TeamCity构建代理与手动构建正常工作的计算机是同一台计算机。我会更新这个问题来反映这一点。 – 2012-01-03 04:49:50

+0

好的,这很有趣。当你在命令行上调用msbuild.exe时,你可以通过/ fl创建一个日志,你应该检查TC日志,看看发生了什么变化。如果你不知道它可以给我发送日志,我可以看看。只需在twitter上给我发言SayedIHashimi。 – 2012-01-03 05:08:12

回答

5

我今天遇到了同样的问题,最终设法解决了这个问题:您只需要删除%USERPROFILE%\AppData\Local\EWSoftware\Sandcastle Help File Builder\Cache文件夹中的缓存文件。

(注:由于您的问题是有关TeamCity的,也许是文件是不是TeamCity的数据文件夹),我认为这是因为缓存文件已经使用旧版本SHFB的产生

在我的案例,并且与新版本不兼容。

+0

嗯,我的TeamCity构建代理以LocalSystem身份运行,但我找不到任何EWSoftware文件夹。我想知道LocalSystem用户的AppData文件夹在哪里? – 2012-01-19 01:52:59

+0

@TimLong,在Win7上,LocalSystem用户配置文件位于C:\ Windows \ system32 \ config \ systemprofile中;在XP上它在'C:\ Documents and Settings \ LocalService'中。 – 2012-01-19 09:21:50

+0

感谢所有帮助托马斯。案件结案。 – 2012-01-19 15:53:03