I'm using Wix XmlConfig to change an XML file, especially.
The following code will throw exceptions:
SchedXmlConfig: Error 0x8007007a: failed to copy XmlConfig record Id SchedXmlConfig: Error 0x8007007a: failed to read XmlConfig table Error 25540. There was a failure while configuring XML files.
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_id"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC"
Name="id"
Value="Date-UTC"/>
<!--<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_logHeaderName"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC"
Name="logHeaderName"
Value="date"/>-->
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_required"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC"
Name="required"
Value="false"/>
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_defaultValue"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC"
Name="defaultValue"
Value="false"/>
The above code works fine without the AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_defaultValue Item.
But it will fail when include the AdvancedLogging_InterACT_LogDefinition_selectedFields_Date_UTC_defaultValue.
Could someone give some clue?
After some search. Here the post figure out the issue is caused by the length an XmlConfig "Id". The solution is to reduce the length of the id. Refined code as followed.
<!--<logField id="Date-UTC" logHeaderName="date" required="false" defaultValue="" />-->
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_Date_UTC"
File="$(var.ApplicationHostConfigPath)"
Action="create"
Node="element"
ElementPath="/configuration/location[\[]@path='InterACT'[\]]/system.webServer/advancedLogging/server/logDefinitions/logDefinition[\[]@baseFileName='InterACT'[\]]/selectedFields"
Name="logField"
On="install"
Sequence="1006">
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_Date_UTC_id"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_Date_UTC"
Name="id"
Value="Date-UTC"/>
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_Date_UTC_logHeaderName"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_Date_UTC"
Name="logHeaderName"
Value="date"/>
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_Date_UTC_required"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_Date_UTC"
Name="required"
Value="false"/>
<util:XmlConfig Id="AdvancedLogging_InterACT_LogDefinition_Date_UTC_defaultValue"
File="$(var.ApplicationHostConfigPath)"
ElementId="AdvancedLogging_InterACT_LogDefinition_Date_UTC"
Name="defaultValue"
Value="false"/>
</util:XmlConfig>
User contributions licensed under CC BY-SA 3.0