MSBuild reports that build Failed however the log reports Build Successful
I'm having trouble with an MSBuild script as it's executing correctly, but in TFS Build Explorer it reports a Fail (red X icon). However, despite all the builds reporting failed, if I examine the logs, they look fine, and end with :
Done building target "EndToEndIteration" in project "TFSBuild.proj". Done Building Project "C:\Builds\EDRM Development\CI_Development_IW471_UserGroup_CG3\BuildType\TFSBuild.proj" (EndToEndIteration target(s)).
Build succeeded. 0 Warning(s) 0 Error(s)
What exactly is Build Explorer using to determine the success of the build script ?
The script itself is using the MSBuild Extension Pack (from CodePlex) to开发者_运维知识库 build a solution containing 40+ VB6 projects. So that it can be run by team build, i've implemented target EndToEndIteration, with the build target as a 'DependsOnTargets'. EndToEndIteration is the only one of team build's targets that I have implemented in the script (it appears to be the only mandatory one ?).
When i run the script from the command line it reports success also, so it's only Build Explorer that's indicating a failure.
Any ideas why this is happening ?
The success of the build is determined by ALL Tasks ended with success pattern (if one fails it may be consider as partially succeed build, but the icon will still remain as a failure icon with small green success icon:)
Try to look at build log's, because it seems, that some pre or past run steps are failing (unable to copy sth, etc). The easiest way is to determine where the problem is, is to schedule the build from Visual Studio with maximum verbosity level for each Task.
Thanks for the reply. All tasks were ending with success.
I've just found out the solution though, so I'll add it here.
As I'm building a VB6 solution (comprising 40+ projects), I'd created a pure msbuild script, that i'd originally been running from the command line. To use it with team build for CI, i'd added a target "EndToEndIteration" as this is the only mandatory target for a new msbuild script in team build (i.e. a script not created via TFS's create build script wizard). This results in the problem above, where even if the script executes perfectly, build explorer still reports failure.
The solution is to create a build script using the TFS wizard (for any .Net .sln file - it doesn't matter - the reference to it will be deleted). Then take a copy of this tfsbuild.proj file and strip out the details relating to the .Net project and paste in your msbuild targets. Then implement target "CoreCompile" to initiate the targets you pasted in.
精彩评论