Convert Web.config Paste as First Child

When converting web.config, how do I insert the web.config node file as the first child of the parent? So i

<configuration> <system.webServer> <rewrite> <rules> <rule name="Foo" stopProcessing="true"> ... </rule> <rule name="Bar" stopProcessing="true"> ... </rule> </rules> </rewrite> </system.webServer> </configuration> 

And I want to insert another rule as the first rule. The code below from web.Release.config only adds it to the end.

 <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <system.webServer> <rewrite> <rules> <rule name="Blah" stopProcessing="true" xdt:Transform="Insert"> ... </rule> </rules> </rewrite> </system.webServer> </configuration> 
+7
xslt
source share
1 answer

It did the trick

 <rule name="Blah" stopProcessing="true" xdt:Transform="InsertBefore(/configuration/system.webServer/rewrite/rules/rule)"> ... </rule> 
+13
source share

All Articles