Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Quick app.config question

Quick app.config question

Scheduled Pinned Locked Moved C#
questiondebugging
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Megidolaon
    wrote on last edited by
    #1

    I have a default directory saved in my app.config and also another directory. In the options of my program the user is supposed to be able to change the other directory or restore the default. Yet, that doesn't seem to work properly. At program start (first time) default and other directory have the same value. In the options I use a FolderBrowseDialog and then display the SelectedPath in a textbox. When the user clicks apply/ok the value of said textbox is written into the app.config (presumably). Yet, when opening another form to use that changed directory (I double and triple checked for spelling mistakes), the default directory is still used. I checked the .exe.config and .vshost.exe.config files in the debug folder, yet they, too remain unchanged after changing the directory. But when I read the config value during runtime with config.AppSettings.Settings["elementPath"].Value, the value is the changed one as long as I stay on the same form I changed it on. Why does that happen? Thanks.

    R 1 Reply Last reply
    0
    • M Megidolaon

      I have a default directory saved in my app.config and also another directory. In the options of my program the user is supposed to be able to change the other directory or restore the default. Yet, that doesn't seem to work properly. At program start (first time) default and other directory have the same value. In the options I use a FolderBrowseDialog and then display the SelectedPath in a textbox. When the user clicks apply/ok the value of said textbox is written into the app.config (presumably). Yet, when opening another form to use that changed directory (I double and triple checked for spelling mistakes), the default directory is still used. I checked the .exe.config and .vshost.exe.config files in the debug folder, yet they, too remain unchanged after changing the directory. But when I read the config value during runtime with config.AppSettings.Settings["elementPath"].Value, the value is the changed one as long as I stay on the same form I changed it on. Why does that happen? Thanks.

      R Offline
      R Offline
      Ravi Bhavnani
      wrote on last edited by
      #2

      Clickety[^]. /ravi

      My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups