Modify values for WCF config in app.config

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?QWxoYW1icmEgRWlkb3MgRGVzYXJyb2xsbw==?=

    Modify values for WCF config in app.config

    Hi misters,



    i have an app.config of my App that uses WCF.



    I need change the configuration servicemodel, and I want update somes values.



    //standard method from System.Configur ation
    Configuration appConfig = ConfigurationMa nager.OpenExeCo nfiguration( "Path
    to my App.config");

    //the main section in the app.config file for WCF
    ServiceModelSec tionGroup serviceModel =
    ServiceModelSec tionGroup.GetSe ctionGroup( appConfig );



    First, how can I set values for modify some endpoint address, for change
    localhost and port and set another values.



    <system.service Model>
    <bindings>
    <netTcpBindin g>
    <binding name="NewBindin g0" maxReceivedMess ageSize="100000 000">
    <readerQuotas maxArrayLength= "163840000" />
    <security mode="None">
    <transport clientCredentia lType="Windows" protectionLevel ="None"
    />
    <message clientCredentia lType="Windows" />
    </security>
    </binding>
    </netTcpBinding>
    </bindings>
    <client>
    <endpoint address="net.tc p://localhost:8090/ServicioBase/servicio"
    binding="netTcp Binding" bindingConfigur ation="NewBindi ng0"
    contract="GRUPO BACKUP.WCF.Serv icioBase.Contra to.IServicioBas e"
    name="AgenteSer vicioBase" />
    <endpoint address="net.tc p://localhost:8091/ServicioLog/servicio"
    binding="netTcp Binding" bindingConfigur ation="NewBindi ng0"
    contract="GRUPO BACKUP.WCF.Log. Contrato.ILog"
    name="AgenteLog " />
    </client>
    </system.serviceM odel>



    Then, how I can refresh section or app.config ? using
    System.Configur ation.Configura tionManager.Ref reshSection(... ) ???


    ConfigurationMa nagerRefreshSec tion("system.se rviceModel")
    ConfigurationMa nager.RefreshSe ction("system.s erviceModel/services")
    ConfigurationMa nager.RefreshSe ction("system.s erviceModel/bindings")



    Any ideas, suggestions, comments ?

    Thanks in advance, greetings, your help is very grateful !!






    --





Working...