我有一个使用Wix进行设置的Wcfservice。
在安装过程中,我有一个图形用户界面,它收集不同的设置,然后在Product.wxs中更改这些设置。但是我很难找到我想要更改的baseAddress设置。
我的配置文件有这个部分:
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="Default">
<serviceMetadata httpGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="Default" name="OurServiceLibrary.OurService">
<clear/>
<endpoint name="OurBasicHttpBinding" address="basic" binding="basicHttpBinding" contract="OurServiceLibrary.IOurService" listenUriMode="Explicit"/>
<host>
<baseAddresses>
<!-- The base-address must be updated with the correct url for the hosting machine. -->
<add baseAddress="http://localhost:8081/ourservice"/>
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>当我尝试更改设置时,我使用的代码是:
<!--Put path to settings in local variable-->
<?define ServiceModelSettingsPath="//configuration/system.ServiceModel/services/service/host/baseAddresses/" ?>
<!--Modify settings with values entered in the installation UI-->
<util:XmlFile Id="ModifyServiceBaseAdress"
Action="setValue"
Permanent="yes"
ElementPath="$(var.ServiceModelSettingsPath)/add"
Name ="baseAddress"
File="[#OurServiceSettingsFile]"
Value="connectionString=[SERVICEBASEADRESS_VALUE]"
SelectionLanguage="XPath"
Sequence="1" />当尝试运行安装程序时,我得到一个错误,说“找不到节点: //configuration/system.ServiceModel/services/service/host/baseAddresses//add in XML file”
显然,到节点的路径是错误的,但我看不出是怎么回事,有人能帮我吗?
发布于 2012-12-17 19:37:30
就是这样,一个简单的拼写错误。双斜杠没有任何区别。但在path中更改为serviceModel确实做到了。
然后我发现了另一个错误,我在设置值时不需要connectionString=,只需要:
Value="EVENTREPORTINGADDRESS_VALUE“
谢谢!
https://stackoverflow.com/questions/13912048
复制相似问题