Xml wix安装程序中web.config中的多个更改
我正在使用wix安装程序,希望修改web应用程序的web.config文件中的连接字符串和一些应用程序设置。 我正在使用util:XmlFile进行修改。 但当我运行安装程序时,修改只应用于连接字符串Xml wix安装程序中web.config中的多个更改,xml,wix,windows-installer,Xml,Wix,Windows Installer,我正在使用wix安装程序,希望修改web应用程序的web.config文件中的连接字符串和一些应用程序设置。 我正在使用util:XmlFile进行修改。 但当我运行安装程序时,修改只应用于连接字符串 <Property Id="DB_USER" Value="sa"/> <Property Id="DB_PASSWORD" Value="sa"/> <Property Id="DB_SERVER" Value="LOCAL"/> <Property I
<Property Id="DB_USER" Value="sa"/>
<Property Id="DB_PASSWORD" Value="sa"/>
<Property Id="DB_SERVER" Value="LOCAL"/>
<Property Id="DB_DATABASE" Value="MailboxMigration_DB"/>
<Property Id="SMTP_port" />
<Property Id="SMTP_server" />
<Property Id="Email_Address" />
<Property Id="Email_Pass" />
之后,我将在对话框中设置属性。
在修改组件中,我正在应用更改
<util:XmlFile Id="ModifyConnectionString"
Action="setValue"
Permanent="no"
ElementPath="/configuration/connectionStrings/add[\[]@name='MigratorDB'[\]]"
Name="connectionString"
File="[INSTALLFOLDER]web.config"
Value='Data Source=[DB_SERVER]; Initial Catalog=[DB_DATABASE]; User Id=[MMDB_USER]; Password=[MMDB_PASSWORD];'
SelectionLanguage="XSLPattern"
Sequence="1" />
<util:XmlFile Id="Server"
Action="setValue"
Permanent="no"
ElementPath="/configuration/appSettings/add[\[]@key='SMTPserver'[\]]"
Name="value"
File="[INSTALLFOLDER]web.config"
Value='[SMTP_server]'
SelectionLanguage="XSLPattern"
Sequence="2" />
与其余3个值相同。
但只对“connectionstring标记”进行了修改
结果web.config为
<connectionStrings>
<add name="MigratorDB" providerName="System.Data.SqlClient" connectionString="Data Source=Arslan; Initial Catalog=MailboxMigration_DB6; User Id=abc6; Password=abc;"/></connectionStrings>
<appSettings>
<add key="SMTPport" value=""/>
<add key="SMTPserver" value=""/>
<add key="EmailAddress" value=""/>
<add key="EmailPass" value=""/>
能否尝试使用SelectionLanguage=“XPath”谢谢您的帮助,但问题是..属性ID包含小写字符。