Linked Questions

Popular Questions

How to remove element from web.config file?

Asked by At

I want to remove some elements from web.config (it is installed in this installation) file if some PROP="0"

<configuration>
 <thingy>
  <stuff>
   <item type='value1'  name='name1' file='node1.txt'/>
   <item type='value2' name='name2' file='node2.txt'/>
  </stuff>
 </thingy>
</configuration>

I am trying to do this

<util:XmlConfig
  On="install"
  Action="delete"
  Id="RemoveAnElement"
  Node="element"
  File="Application.dll.config"
  VerifyPath="/configuration/thingy/stuff/item[\[]@type='value1'[\]]"
  ElementPath="/configuration/thingy/stuff"
  Sequence="100"
/>

No errors but element still exists. How to remove it?

Related Questions