开发者

msbuild xmlupdate delete node in web.config

How do I use MSBuild Community Tasks to delete a node开发者_如何学编程 in web.config. I can update a node using XmlUpdate task but I cannot delete a node. Any ideas.


The XmlUpdate task can do it. I am using the nightly build from 11/30/2010.

 <XmlUpdate
      XmlFileName="web.config"
      XPath="/configuration/appSettings/add[@key='setting2']" 
      Delete="true" />

The XmlFile task of the MSBuild Extension Pack can also do it:

 <XmlFile
      TaskAction="RemoveElement"
      File="web.config"
      XPath="/configuration/appSettings/add[@key='setting2']" />
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜