在MSBuild任务中抛出错误

如何从MSBuild任务中抛出错误,并强制构建失败.就像是:

<Task>
  <ThrowError Condition="$(SomeCondition)" Message="There was a problem with the build" />
</Task>
使用Error Task

<Error Condition="$(SomeCondition)" Text="There was a problem with the build" />
翻译自:https://stackoverflow.com/questions/2402265/throw-an-error-in-an-msbuild-task

转载注明原文:在MSBuild任务中抛出错误