在MSBuild任务中引发错误

acc*_*2me 14 msbuild

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

<Task>
  <ThrowError Condition="$(SomeCondition)" Message="There was a problem with the build" />
</Task>
Run Code Online (Sandbox Code Playgroud)

Luh*_*ann 23

使用错误任务

<Error Condition="$(SomeCondition)" Text="There was a problem with the build" />
Run Code Online (Sandbox Code Playgroud)