Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make Settings.settings data persistent

I have a Windows Forms application and I'm using the Settings.settings class to store user's configuration (email preferences, theme, etc) I didn't realize that after the user closes the app, the settings are gone!!

This app is about to be released to production, so I have to provide a solution ASAP.

like image 385
franko_camron Avatar asked Nov 11 '11 17:11

franko_camron


People also ask

Where are user settings saved?

User settings are saved in a file within a subfolder of the user's local hidden application data folder.

What are application settings?

Application settings enables developers to save state in their application using very little custom code, and is a replacement for dynamic properties in previous versions of the . NET Framework.

How do I change the default properties in C#?

To check your settings: Go to Solution Explorer > expand the Properties node of your project > double-click the . settings file. There you can create your own settings with User scope and edit it at runtime, if that is your intention.


1 Answers

You do have to save them after you set them. Have you tried:

Properties.Settings.Default.Save();
like image 141
DanTheMan Avatar answered Sep 30 '22 06:09

DanTheMan