msbuild xmlupdate delete node in web.config

你离开我真会死。 提交于 2019-12-08 17:37:02

问题


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.


回答1:


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']" />


来源:https://stackoverflow.com/questions/4526847/msbuild-xmlupdate-delete-node-in-web-config

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!