0

My app.config is as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup> 
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="ESDServiceSoapBinding">
                <security mode="Transport" />
            </binding>
            <binding name="ESDServiceSoapBinding1">
                <security mode="Transport" />
            </binding>
            <binding name="ESDServiceSoapBinding2" />
            <binding name="ESDServiceSoapBinding3" />
            <binding name="ESDServiceSoapBinding4">
                <security mode="Transport" />
            </binding>
            <binding name="ESDServiceSoapBinding5" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://downloadswebregr.mydomain.com:443/ESDServiceWeb/services/ESDEntitlementServiceAPI"
            binding="basicHttpBinding" bindingConfiguration="ESDServiceSoapBinding1"
            contract="ESDRegService.ESDEntitlementServiceAPI" name="ESDEntitlementServiceAPI" />
        <endpoint address="http://eotwasqa1.mydomain.com:19081/ESDServiceWeb/services/ESDEntitlementServiceAPI"
            binding="basicHttpBinding" bindingConfiguration="ESDServiceSoapBinding3"
            contract="ESDBackupService.ESDEntitlementServiceAPI" name="ESDEntitlementServiceAPI1" />
        <endpoint address="https://downloadsweb.mydomain.com:443/ESDServiceWeb/services/ESDEntitlementServiceAPI"
            binding="basicHttpBinding" bindingConfiguration="ESDServiceSoapBinding4"
            contract="ESDBackupService.ESDEntitlementServiceAPI" name="ESDEntitlementServiceAPI2" />
    </client>
</system.serviceModel>
</configuration>

I tried embedding this inside the executable using the build action "Embedded Resource" but then my application is not able to read the services information. I want to get rid of it as I want to ship only a single file. i.e. the executable. I searched for similar questions on stackoverflow and people say, it should be outside so that it can be configured or modified from outside. Please note that, I dont want it to get changed from outside and just want to embed it.

The King
  • 833
  • 1
  • 15
  • 41

1 Answers1

0

The basic purpose of the configuration file is to allow the external users to configure something in your application.Hence the configuration files needs to be distributed to the end users.If you intend not to allow changes to the end points ,it has to created inside your code as suggested in the previous comment.

Check the following link.

Create WCF endpoint configurations in the client app, in code?

Community
  • 1
  • 1
Vasudevan Kannan
  • 911
  • 2
  • 7
  • 22