none
how to change configuration of WPF application at runtime by modifying App.config

    Question

  • I have following App.config in my WPF project.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <appSettings>
        <add key="IPAddress" value="127.0.0.1"/>
        <add key="Port" value="27015"/>
        <add key="Mode" value="Ucd"/>
        </appSettings>
     </configuration>

    when I execute my application, it creates App file in output folder.

    I bound values of these keys to my application's UI.

    now, my requirement is when I explicitly change the value of specific key (e.g Mode = "Acd") I want it to be changed on UI when I directly run my .exe file without compilation. I found vice-versa solution (i.e. from UI to config file) on community but not this one.

    plz suggest.


    Tuesday, July 10, 2012 8:59 AM

Answers

All replies