Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get TeamCity to recognize msbuild compilation errors, using the Rake runner

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?

like image 317
Seth Petry-Johnson Avatar asked Dec 10 '09 20:12

Seth Petry-Johnson


1 Answers

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

like image 128
Seth Petry-Johnson Avatar answered Oct 11 '22 11:10

Seth Petry-Johnson