如何从MSBuild任务中抛出错误并强制构建失败。类似的东西:
<Task>
<ThrowError Condition="$(SomeCondition)" Message="There was a problem with the build" />
</Task>
答案 0 :(得分:23)
<Error Condition="$(SomeCondition)" Text="There was a problem with the build" />
答案 1 :(得分:2)
Error-task可以解决问题。
<Error
Text="errormessage"
Condition="errorcondition" />
答案 2 :(得分:1)
您是否尝试过Error而不是ThrowError?它对我有用;)