Is there a way to insert an xml node as the first child of the parent element instead of as its last child? I tried using <MSBuild.ExtensionPack.Xml.XmlFile TaskAction="AddElement"....> but could not get it to insert before the already existing
Here's why I need this: I use Entreprise Library's environment overrides with the MergeConfiguration.exe command (namely for connection strings). The problem with this is that for some obscure reason, the <clear /> tag is removed by the merge command
in the following section:
<add name="app_db" connectionString="..." providerName="System.Data.SqlClient" />
<add name="ApplicationServices" connectionString="..." providerName="System.Data.SqlClient" />
The <clear /> tag is necessary when an application in a sub-folder uses the same connection string name a the application in the root folder. I really don't understand why IIS inherits Web.Config files!?! But that another story.
I tried using MSBuild community task XmlMassUpdate but since the <clear /> tag does not have any attributes to use as a key, it won't work. I tried using MSBuild.ExtensionPack.Xml.XmlFile to add a <clear /> tag but it adds it at the end...
Can you provide any help on how I could achieve this ?