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. Wheres my data when app.config is an Embedded Resource

Wheres my data when app.config is an Embedded Resource

Scheduled Pinned Locked Moved C#
csharphardwarequestionlearning
3 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.
  • C Offline
    C Offline
    Christopher Stratmann
    wrote on last edited by
    #1

    Ok I you create a new C# windows project and then create a ".settings" with an item (string) and (user) as the type. Now this will create an app.config file associated with the project. Go into the properties for the app.config and change the Build Action to (Embedded Resource). Now in your windows form create and edit box and a button which loads and saves the setting that your created. Build the project. Go into the bin folder and click on the exe file to run the project. Try changing the settings and saving the settings. Close the project and load it back up by clicking on the exe file to verify that the save works which it will. BUT WHERE DOES IT SAVE TOO?????????? I cant figure it out...... Chris

    H 1 Reply Last reply
    0
    • C Christopher Stratmann

      Ok I you create a new C# windows project and then create a ".settings" with an item (string) and (user) as the type. Now this will create an app.config file associated with the project. Go into the properties for the app.config and change the Build Action to (Embedded Resource). Now in your windows form create and edit box and a button which loads and saves the setting that your created. Build the project. Go into the bin folder and click on the exe file to run the project. Try changing the settings and saving the settings. Close the project and load it back up by clicking on the exe file to verify that the save works which it will. BUT WHERE DOES IT SAVE TOO?????????? I cant figure it out...... Chris

      H Offline
      H Offline
      Hayder Marzouk
      wrote on last edited by
      #2

      Hi, It saves it somewhere in C:\Documents and settings\UserName\LocalSettings\Application Data \Your Application Name .Exe XXXXXXXXXXXXXXXXXXXXXXXXXXX\VersionNumber\user.config Try search *.config in your documents and settings and u will find it. That's because .Net wants to save Config settings for each Windows user. so it does not touch the application.config file that can be shared between many users. That happens even u don't set the Build action to Embedded Resource wich is not logic because the config file must not be embedded in the exe. HTH. Hayder Marzouk

      C 1 Reply Last reply
      0
      • H Hayder Marzouk

        Hi, It saves it somewhere in C:\Documents and settings\UserName\LocalSettings\Application Data \Your Application Name .Exe XXXXXXXXXXXXXXXXXXXXXXXXXXX\VersionNumber\user.config Try search *.config in your documents and settings and u will find it. That's because .Net wants to save Config settings for each Windows user. so it does not touch the application.config file that can be shared between many users. That happens even u don't set the Build action to Embedded Resource wich is not logic because the config file must not be embedded in the exe. HTH. Hayder Marzouk

        C Offline
        C Offline
        Christopher Stratmann
        wrote on last edited by
        #3

        Thanks I see it.

        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