MSBuild build step runner indicates failure even though ContinueOnError is set to "True" at the point of "perceived" failure

TeamCity 9.1.5 (build 37377)

I created a new build configuration with an MSBuild build step runner which executes "build.proj" in the root of the checkout directory.

MSBuild version: Microsoft Build Tools 2013
MSBuild ToolsVersion: 12.0
Run platform: x86

Build.proj has several <MSBuild /> tasks in its default target, one of which has the ContinueOnError attribute set to "True".

      ContinueOnError="True" />

Basically, building Test.sln is expected to fail.

When this build is run, TeamCity completes the build as expected, but indicates that the build failed because of the expected errors produced when building Test.sln.

For example,

[19:00:21][Test\ProjectA\ProjectA.csproj] PreBuildEvent
[19:00:21][PreBuildEvent] Exec
[19:00:21][Exec] "C:\Test\ProjectB\bin\Release\ProjectB.exe"
[19:00:21][Exec] The system cannot find the path specified.
[19:00:21][Exec] C:\Program Files (x86)\MSBuild\12.0\bin\Microsoft.Common.CurrentVersion.targets(1131, 5): error MSB3073: The command "C:\Test\ProjectB\bin\Release\ProjectB.exe" exited with code 3.

I expected TeamCity to ignore the error and indicate that the build succeeded.

The reason the error is expected is due to a bug in MSBuild not respecting the build order defined defined in the solution, but is beyond the scope of this issue.

When using TFS Build in the same way, TFS Build indicates the build "partially succeeded".

Is this considered a bug/feature request in TeamCity?

Are there any work-arounds?

Thank you.

1 comment
Comment actions Permalink

Hello Rami,

Do you have "Fail build if: an error message is logged by build runner" checkbox enabled on Build Configuration > Failure Conditions page? Please see the comment in the related issue in tracker.


Please sign in to leave a comment.