wix - util:XmlFile 开始 - 在 ElementPath 中不起作用
问题描述
我正在尝试使用 Wix 的 util:XmlFile 在我的服务配置文件中设置主机值。要选择节点,我想使用带有 start-with 功能的 XPath 来更改多个节点。
我在https://www.freeformatter.com/xpath-tester.html上尝试过 XPath 表达式,它工作正常。
<util:XmlFile
Id="SomeId"
Action="setValue"
Permanent="yes"
ElementPath="/configuration/system.serviceModel/services/service[\[]starts-with(@name,'Webservices') and ends-with(@name,'Service')[\]]/host/baseAddresses/add"
Name="baseAddress"
File="[#Service_exe_config]"
Value="[SERVICE_PROTOCOL]://[HOSTADDRESS]/Management/SomeService"
SelectionLanguage="XPath"
Sequence="1" />
XML:
<configuration>
<system.serviceModel>
<services>
<service name="MyCompany.Webservices.V123.Service">
<host>
<baseAddresses>
<add baseAddress="https://localhost/Service"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
从安装程序中,我收到此错误:“错误 25532。找不到节点:”。如果它能正常工作,那就太好了。
解决方案
推荐阅读
- nginx - kubernetes / ingress-nginx 的任何 bash 调查脚本 - 得到 503?
- java - com.sun.proxy.$Proxy439 无法转换为 DDLRecordSetLocalService
- javascript - Mapbox LngLat 对象
- asp.net - 我怎样才能获得数据表的价值呢?当我点击更新。我也想更新我的文本框,但我的数据表只更新
- python - 为什么在 python tkinter exe 中退出命令有时不退出?
- python - 训练独立的目标检测模型
- javascript - TypeError:无法读取未定义的属性'refs' - Next.js App & React
- reactjs - npm 错误!在“...sqk3urlRSf0SyulYvOMeZ”附近解析时 JSON 输入意外结束
- swift - 在 Swift 的可重用类中调用不同的函数
- c# - 如何在 ASP.NET Core 2.2 项目中增加或设置上传媒体文件大小无限制