Search code examples
c#windowsapplication-settings

Windows application settings


I have a windows app written in C# (.net 3.5), and have a Settings.settings file that holds the application's settings.

When I do something like this:

Properties.Settings.Default.HSLastSend = DateTime.Now;
Properties.Settings.Default.Save();

it gets saved and persisted when I restart the application, however the Settings.settings file still has the original value. I can't seem to find where this new value is stored. I would have expected the Settings.settings file to have the new value when I went into it.

Is this a problem or normal?

Cheers in advance,

Stu


Solution

  • Setting.settings provide default values for the application, instead changed one, is saved in your binary file resources. You can prove it by loading your application after save changed settings, and you will get you changed value, even if Settings file has still "old" one.

    EDIT

    Just note that Properties.Settings.Default.

    On XP machine it should be at:

    C:\Documents and Settings\"YourMachineUserName"\Application Data\

    Regards.