我有一个使用 Wix 3.5 构建的 MSI 安装程序,我正在尝试在安装过程中使用以下命令编辑 web.config xml 文件:
<Component Id="EditWebConfigToUseCertificate" Guid="xxx">
<util:XmlConfig Id="configureX509Value"
File="[WebServiceFolder]web.config"
ElementPath="configuration/system.serviceModel/behaviors/serviceBehaviors/behavior[\[]1[\]]/serviceCredentials/serviceCertificate"
Name="x509FindType"
Value="FindBySubjectName"
Sequence="1" />
</Component>
我不能让它工作,我不能让它改变文件上的任何属性。MSI 安装正常,但 web.config 从未更改。我检查了文件路径(硬编码),XPath 也是正确的。为什么不修改文件?安装日志显示没有错误。
这是我的 web.config:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E31" />
</assemblies>
</compilation>
<!-- do not use asp.net authentication -->
<authentication mode="None" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<clear />
<behavior name="AuthenticationServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<!-- service credentials -->
<serviceCredentials>
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySerialNumber" findValue="00 91 d9 2e 07 82 d8 99 c0" />
</serviceCredentials>
</behavior>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
<!-- service credentials -->
<serviceCredentials>
<serviceCertificate storeLocation="LocalMachine" storeName="My" x509FindType="FindBySerialNumber" findValue="00 91 d9 2e 07 82 d8 99 c0" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
</configuration>