1

NSISを使用してApplication.configファイルの既存の値を上書きしようとしています。

'endpoint address ="http://DefaultWebService.asmx"'を変更したい

'endpoint address = "http://MyWebService.asmx"'

私の設定ファイルは次のようになります。

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.serviceModel>
<client>
  <endpoint address="http://DefaultWebService.asmx"
    binding="customBinding" bindingConfiguration="MyServiceSoap12"
    contract="WebServiceProxies.MyServiceSoap" name="MyServiceSoap12" />
</client>
</system.serviceModel>
</configuration>

私のNSISでは私が使用しています:

WriteIniStr "$MyApp.exe.config" "system.serviceModel" "endpoint address" "endpoint address="http://MyWebService.asmx"

しかし、これはただ追加します

[system.serviceModel]
endpoint address=http://MyWebService.asmx

.configファイルの最後に。

どこが間違っているのですか?

ありがとう

4

1 に答える 1

2

問題は、.iniファイルを更新するWriteIniStrを使用していて、application.configがXMLファイルであるということです。代わりに、このプラグインのようなものを使用する必要があります。

于 2012-04-11T12:46:58.350 に答える