tags:

views:

70

answers:

3

How do you throw an error from within an MSBuild task and force the build to fail. Something like:

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

Use the Error Task

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

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

Thomas Wanner
A: 

The Error-task would do the trick.

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