如何使用 Rake 运行程序让 TeamCity 识别 msbuild 编译错误
我有一个带有 Rake 构建脚本的 .NET 项目。 Rake 调用 msbuild.exe 来进行实际的编译。当我使用 Rake 运行程序配置 TeamCity 5.0 构建时,TC 无法识别编译错误。当发生编译错误时:
- 构建确实中止并被标记为失败;
- 日志概述不包含编译错误消息。我必须去构建日志 ->所有消息查看失败;
- 不会通过电子邮件报告编译失败。我的电子邮件通知模板中的 {COMPILATION_ERRORS} 占位符被替换为空白字符串。
我需要做什么才能让 TC 识别出编译错误?
I have a .NET project with a Rake build script. Rake calls msbuild.exe to do the actual compilation. When I configure a TeamCity 5.0 build using the Rake runner, compilation errors are not recognized as such by TC. When a compilation error occurs:
- The build does abort and is flagged as a failure;
- The log overview does not contain the compilation error message. I have to go to Build Log -> All Messages to see the failure;
- The compilation failure is not reported via email. The {COMPILATION_ERRORS} placeholder in my email notification template is replaced with a blank string.
What do I have to do to get TC to recognize the compilation errors?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案如TeamCity 支持论坛上的此帖子所示,是告诉MSBuild 使用“/l”开关使用特殊的 TeamCity 日志侦听器:
该 dll 位于 TeamCity 代理目录中:{agent}/plugins/dotnetplugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll
The answer, as shown in this thread on the TeamCity support forum, is to tell MSBuild to use a special TeamCity log listener using the "/l" switch:
The dll ships in the TeamCity agent directory: {agent}/plugins/dotnetplugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll