开发者

MSBuild XmlUpdate not failing

Im using the MSBuild task XmlUpdate to update my log4net file 开发者_JS百科when deploying and it works like charm :). However today I discovered a BIG problem.

Problem: If I by accident specify the wrong Xpath, the script do not fail.

MSBuild Task config with error:

<Target Name="UpdateLog4NetConfig" DependsOnTargets="UpdateAppConfig">

  <XmlUpdate XmlFileName="$(ReleasePath)\log4net.config"
             Xpath="//log4net/root/ERRORNODE/@value"
             Value="WARN"
             ContinueOnError="false"/>
</Target>

When I run this I get:

[XmlUpdate] Updating Xml Document "D:\TeamCity Agents\...\output\log4net.config".
[XmlUpdate]   0 node(s) selected for update.
[XmlUpdate] XmlUpdate Wrote: "WARN".

But the build continues with the next tasks!

Question: How do I ensure that when an XmlUpdate "fails" , it actually stops the entire script with a big FAILED message?

(I know an XPath not actually "fails", but one should be able to tell if any changes where applied i think)

Kind regards

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜