Modify ServiceReferences.ClientConfig file using bat before deploying SilverLight solution

六月ゝ 毕业季﹏ 提交于 2019-12-25 08:17:32

问题


my team is developing a silverlight application and we are now switching our solution to https on our server but we would like to use http locally. So, in the XAP file that results when building the app there is a ServiceReferences.ClientConfig having the configuration for the web services that are referenced in the project. The issue is that I would like to have some configuration when I am running it locally and have some other configuration when I deploy it. We decided to alter the ServiceReferences.ClientConfig before building because otherwise it would be encapsulated in the .xap file. We are using msbuild in a bat file to deploy the solution. The config file:

<configuration>
    <system.serviceModel>
        <bindings>
            <customBinding>
                <binding name="CustomBinaryBinding">
                  <binaryMessageEncoding />
                  <httpTransport maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" />
                </binding>
            </customBinding>
        </bindings>
        <client>
          <endpoint address="../../PlatformAdminUtil.svc"
               binding="customBinding" bindingConfiguration="CustomBinaryBinding"
               contract="PlatformAdminUtil.PlatformAdminUtil" name="CustomBinding_PlatformAdminUtil" />
         </client>
    </system.serviceModel>
</configuration>

I wish to change the <httpTransport/> tag into <httpsTransport/>. I'm new on scripting in bat files so I need some help on the script that would manage this.

来源:https://stackoverflow.com/questions/40527751/modify-servicereferences-clientconfig-file-using-bat-before-deploying-silverligh

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!