Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 103223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:05:24+00:00 2026-05-11T01:05:24+00:00

What is the recommended location to save user preference files? Is there a recommended

  • 0

What is the recommended location to save user preference files? Is there a recommended method for dealing with user preferences?

Currently I use the path returned from typeof(MyLibrary).Assembly.Location as a default location to store files generated or required by the application.

EDIT: I found two related/interesting questions:

  • Best place to save user information for Windows XP and Vista applications
  • What's the way to implement Save / Load functionality?

EDIT #2: This is just a note for people like me who had never used settings before. Settings are pretty useful, but I had to do a whole bunch of digging to figure out what was going on (coming from the Python world, not something I am used too). Things got complicated as I wanted to save dictionaries and apparently they can’t be serialized. Settings also seem to get stored in 3 different files depending on what you do. There is an app.config, user.config and a settings.setting file. So here are two more links that I found useful:

  • http://social.msdn.microsoft.com/Forums/en-US/csharpgeneral/thread/ddeaca86-a093-4997-82c9-01bc0c630138
  • http://social.msdn.microsoft.com/Forums/en-US/winforms/thread/efe370dc-f933-4e55-adf7-3cd8063949b0/
  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:05:25+00:00Added an answer on May 11, 2026 at 1:05 am

    You can use the Application Settings easily enough.

    If you haven’t done so before just right click on the project and choose Properties. Select the Settings tab. Make sure you chose ‘User’ for the scope (otherwise the setting is read-only).

    The code to access this is simple:

    forms.Width = Application1.Properties.Settings.Default.Width; 

    If you need to save it:

    Application1.Properties.Settings.Default.Width = forms.Width; Application1.Properties.Settings.Default.Save(); 

    In the sample above, Width is the custom setting name you define in the Settings tab and Application1 is the Namespace of your application.

    Edit: Responding to further questions

    You mentioned you wanted to store Dictionary objects in the Settings. As you discovered, you can’t do this directly because Dictionary objects are not serializable. However, you can create your own serializable dictionary pretty easily. Paul Welzer had an excellent example on his blog.

    You have a couple of links which sort of muddy the situation a little. Your original question is where to save ‘User Preference Files’. I’m pretty certain Microsoft’s intention with the Settings functionality is exactly that… storing user skin preferences, layout choices, etc. It not meant as a generic repository for an application’s data although it could be easily abused that way.

    The data is stored in separate places for a good reason. Some of the settings are Application settings and are read-only. These are settings which the app needs to function but is not specific to a user (for example, URIs to app resources or maybe a tax rate). These are stored in the app.config.

    User settings are stored in an obfuscated directory deep within the User Document/Settings folder. The defaults are stored in app.config (I think, can’t recall for certain off the top of my head) but any user changes are stored in their personal folder. This is meant for data that changes from user to user. (By ‘user’ I mean Windows user, not your app’s user.)

    Hope this clarified this somewhat for you. The system is actually pretty simple. It might seem a little foreign at first but after a few days of using it you’ll never have to think of it again… it just works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a recommended location to store static resources (images, css, js, etc) in
Is there anyway to track the location (as precise as possible) of a user
Are there any examples/recommended approaches for implementing a location picker (for want of a
What is the recommended way to change the repository location from /srv/gitosis in Gitosis
Are there any recommended libraries, patterns or examples on how to implement Prefetching and/or
The following script was recommended to use a List Page to show a Google
Using SqlParameters is a recommended method to prevent SQL Injection in your database queries.
What is the recommended idiom for checking whether a query returned any results? Example:
Is it possible to use web deploy from multiple developer PC's? When we try
Is there a recommended technique for migrating a large set of paperclip S3 images

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.