Results 1 to 1 of 1

Thread: WCF programmatically instantiate app.config settings

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Jan 2001
    Posts
    1,373

    WCF programmatically instantiate app.config settings

    I have written a WCF service. This is the App.config file for the client application that consumes the service. I want all of this data to be set with the client application's code. How can I do this?

    Code:
    <?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="BasicHttpBinding_IHelloWorldService" allowCookies="true"
                     maxReceivedMessageSize="20000000" maxBufferSize="20000000"  maxBufferPoolSize="20000000">
                <readerQuotas maxDepth="32"
                        maxArrayLength="200000000"
                        maxStringContentLength="200000000"/>
              <security mode="None">
                <transport clientCredentialType="None" />
                <message clientCredentialType="UserName" />
              </security>
            </binding>
          </basicHttpBinding>
        </bindings>
        <client>
          
         <endpoint address="http://localhost/HelloWorldService.svc"
              binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IHelloWorldService"
              contract="HelloWordServiceReference.IHelloWorldService"
              name="BasicHttpBinding_IHelloWorldService" />
        
        </client>
      </system.serviceModel>
      
    </configuration>
    Last edited by robertx; Apr 29th, 2014 at 10:33 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width