Is there a way to **insert** a new XML element at a particular location using
XmlConfig, rather than just adding it?
I am using XmlConfig to register a new IIS handler in applicationHost.config.
Unfortunately, my code ends up adding the new entry at the end of the handler
list, and so the new handler is never activated, as the '*' static handler
appears higher in the list. I can easily go into IIS Manager and reorder the
list so my handler appears higher, but this is the kind of detail which is
inevitably forgotten.
<util:XmlConfig Id="MyHandler" File="[IIS7APPHOST]" Action="create"
ElementPath="//system.webServer/handlers" Name="add" Node="element"
VerifyPath="add[\[]@name='MyCoolHandler'[\]]" Sequence="1" On="install"/>
<util:XmlConfig Id="MyHandler.Name" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="name" Value="MyCoolHandler" Sequence="2"/>
<util:XmlConfig Id="MyHandler.Path" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="path" Value="MyCool" Sequence="3"/>
<util:XmlConfig Id="MyHandler.Type" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="type" Value="MyCoolHandler.Handler,
!(bind.assemblyFullName.MyCoolHandler.dll)" Sequence="4"/>
<util:XmlConfig Id="MyHandler.Verb" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="verb" Value="*" Sequence="5"/>
<util:XmlConfig Id="MyHandler.ResType" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="resourceType" Value="Unspecified" Sequence="6"/>
<util:XmlConfig Id="MyHandler.Access" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="requireAccess" Value="Script" Sequence="7"/>
<util:XmlConfig Id="MyHandler.Precon" File="[IIS7APPHOST]"
ElementId="MyHandler" Name="preCondition" Value="integratedMode" Sequence="8"/>
<util:XmlConfig Id="MyHandler.Remove" File="[IIS7APPHOST]"
Action="delete" ElementPath="//system.webServer/handlers" Node="element"
VerifyPath="add[\[]@name='MyCoolHandler'[\]]" Sequence="1" On="uninstall"/>
What I really want to do is to specify in the Action="create" line that the new
element should be created before the '*' static handler. Any ideas or
suggestions?
Thanks
Grant
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wix-users