如何使用 Rake 运行程序让 TeamCity 识别 msbuild 编译错误

发布于 2024-08-14 02:36:33 字数 325 浏览 3 评论 0原文

我有一个带有 Rake 构建脚本的 .NET 项目。 Rake 调用 msbuild.exe 来进行实际的编译。当我使用 Rake 运行程序配置 TeamCity 5.0 构建时,TC 无法识别编译错误。当发生编译错误时:

  1. 构建确实中止并被标记为失败;
  2. 日志概述包含编译错误消息。我必须去构建日志 ->所有消息查看失败;
  3. 不会通过电子邮件报告编译失败。我的电子邮件通知模板中的 {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:

  1. The build does abort and is flagged as a failure;
  2. The log overview does not contain the compilation error message. I have to go to Build Log -> All Messages to see the failure;
  3. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白色秋天 2024-08-21 02:36:33

答案如TeamCity 支持论坛上的此帖子所示,是告诉MSBuild 使用“/l”开关使用特殊的 TeamCity 日志侦听器:

msbuild /l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,<path to dll>

该 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:

msbuild /l:JetBrains.BuildServer.MSBuildLoggers.MSBuildLogger,<path to dll>

The dll ships in the TeamCity agent directory: {agent}/plugins/dotnetplugin/bin/JetBrains.BuildServer.MSBuildLoggers.dll

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文