自定义任务返回false,日志显示失败,但构建仍成功 [英] Custom Task returns false, log shows Failed but Build is still Successful
问题描述
我不确定这是MsBuild问题还是TeamBuild问题.
我有从Utilities派生的自定义任务.Task
如果任务无法执行它正在工作,它调用Log.LogError(message)并返回false.
我可以看到任务有问题,并且消息在生成日志中.
在看到消息之后正常的失败"
已执行任务"MyTask" -失败.
完成构建目标"MyTargetForTheTask";在项目"TFSBuild.proj"中-FAILED.
即使日志显示失败,但Build Explorer(TFS)仍显示该构建成功.
我正在从AfterDropBuild调用任务:< Target Name = "AfterDropBuild" DependsOnTargets ="MyTargetForTheTask"; />
-A
I'm not sure if this is an MsBuild issue or a TeamBuild issue.
I've got custom task that derives from Utilities.Task
If the task is unable to perform it's work, it call Log.LogError(message) and returns false.
I can see that the task had an issue and the message is in the build log.
After the message I see the normal "failed" message.
Done executing task "MyTask" -- FAILED.
Done building target "MyTargetForTheTask" in project "TFSBuild.proj" -- FAILED.
Even though the log shows failures, the Build Explorer (TFS) shows the build as having succeeded.
I'm invoking the task from AfterDropBuild : <Target Name="AfterDropBuild" DependsOnTargets="MyTargetForTheTask" />
-A
推荐答案
您是否看到了相反的内容?
我的构建运行成功
构建成功.
0警告
0错误
但是当我检查Build Explorer(TFS)显示构建失败时
复制二进制文件到放置位置成功,但是下一行显示FAILED
周围是否有帖子(找不到任何内容) ,这似乎已经关闭)
Have you seen the opposite of this?
I have my build running succeeds
Build succeeded.
0 Warning(s)
0 Error(s)
But when i check the Build Explorer (TFS) shows the build as having Failing
Copying binaries to drop location succeeds, but next line shows FAILED
Is there a post around (couldn't find anything, this seemed the closes)
这篇关于自定义任务返回false,日志显示失败,但构建仍成功的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!