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. Where does Settings.Default.MySetting come from?

Where does Settings.Default.MySetting come from?

Scheduled Pinned Locked Moved C#
question
4 Posts 3 Posters 1 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.
  • B Offline
    B Offline
    buchstaben
    wrote on last edited by
    #1

    Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?

    S M 2 Replies Last reply
    0
    • B buchstaben

      Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?

      S Offline
      S Offline
      Simon P Stevens
      wrote on last edited by
      #2

      The default value is hard coded as an attribute on the property. Look in the Settings.Designer.cs file for the "DefaultSettingValueAttribute" attribute on each property. Note that "user" scope settings can also be stored in a config file in the documents and settings/username/localsettings/application data folder.

      Simon

      B 1 Reply Last reply
      0
      • B buchstaben

        Hi, I'm wondering where a setting's value comes from, if it is not configured in MyApplication.exe.config. Didn't find an answer at msdn yet, so could anyone explain please?

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        I beleive the info is stored in the appconfig file. So when you right click your application in the explorer window and select properties, the settings tab allows you to store information in the app config table.

        Never underestimate the power of human stupidity RAH

        1 Reply Last reply
        0
        • S Simon P Stevens

          The default value is hard coded as an attribute on the property. Look in the Settings.Designer.cs file for the "DefaultSettingValueAttribute" attribute on each property. Note that "user" scope settings can also be stored in a config file in the documents and settings/username/localsettings/application data folder.

          Simon

          B Offline
          B Offline
          buchstaben
          wrote on last edited by
          #4

          Simon Stevens wrote:

          The default value is hard coded as an attribute on the property

          Thanks, that's what I've been looking for.

          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