开发者

How to bind a target within MSBuild to a general error

开发者 https://www.devze.com 2022-12-21 09:42 出处:网络
We are using TFS build and we have a couple of custom steps within the configuration (e.g. running NUnit tests in AfterCompile target, deployment steps in AfterDropBuild target etc.). Now I wanted to

We are using TFS build and we have a couple of custom steps within the configuration (e.g. running NUnit tests in AfterCompile target, deployment steps in AfterDropBuild target etc.). Now I wanted to add the functionality of sending emails on broken builds. I have configured a mail task from MS Community tasks and put it to the BeforeOnBuildBreak target. This works perfectly if there is a compilation error, we are 开发者_Python百科even getting the notification emails.

However, when there is an error in some custom task (e.g. there is a failed test in this NUnit test run), the BeforeOnBuildBreak target is not even executed. Is there some other (more general) target or any other way to execute custom logic in case of any build failure ?


For individual tasks you could set ContinueOnError="True" property and then check for errors, send notification and fail the build manually using the Error task.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号