如何從MSBuild任務中拋出錯誤並強制構建失敗。喜歡的東西:在MSBuild任務中拋出錯誤
<Task>
<ThrowError Condition="$(SomeCondition)" Message="There was a problem with the build" />
</Task>
如何從MSBuild任務中拋出錯誤並強制構建失敗。喜歡的東西:在MSBuild任務中拋出錯誤
<Task>
<ThrowError Condition="$(SomeCondition)" Message="There was a problem with the build" />
</Task>
<Error Condition="$(SomeCondition)" Text="There was a problem with the build" />
您是否嘗試過的,而不是ThrowError錯誤?它適用於我;)
Error-task會做的伎倆。
<Error
Text="errormessage"
Condition="errorcondition" />
同意下面的答案。您可能希望將MSBuild任務引用保留在書籤文件夾中,以及http://msdn.microsoft.com/zh-cn/library/7z253716.aspx。 – dsolimano 2010-03-08 15:21:55