开发者

Throw an Error in an MSBuild Task

开发者 https://www.devze.com 2022-12-22 01:57 出处:网络
How do you throw an error from within a开发者_开发问答n MSBuild task and force the build to fail. Something like:

How do you throw an error from within a开发者_开发问答n MSBuild task and force the build to fail. Something like:

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


Use the Error Task

<Error Condition="$(SomeCondition)" Text="There was a problem with the build" />


The Error-task would do the trick.

<Error
            Text="errormessage"
            Condition="errorcondition" />


Have you tried Error instead of ThrowError ? It works for me ;)

0

精彩评论

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