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 6042729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:49:20+00:00 2026-05-23T06:49:20+00:00

I have a .Net application that uses their user settings. What is the best

  • 0

I have a .Net application that uses their user settings. What is the best time to save these settings?

To be clear, I’m calling this function to save the:

Storage.Properties.Settings.Default.Save()

First, I though to save them on every change, but that’s slow, and don’t seem to be necessary. The documentation suggest that they only need to be saved when the application is closing, in in their example, when a form is closing.

But, what if there are two instances of the application running? It seems that if I wait until Application_Exit event, the settings won’t persist between the instances. The new instance of the application would read the old user settings, causing an error.

So, what’s the best practice for this?

  • 1 1 Answer
  • 0 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. Editorial Team
    Editorial Team
    2026-05-23T06:49:21+00:00Added an answer on May 23, 2026 at 6:49 am

    The answer is application specific, so there is no best practice. Some apps don’t even allow multiple instances, for example.

    But most apps tend to do one of these things:

    • They don’t change settings often, so save an entire set of changes at once (e.g. when applying changes in a configuration dialog).
    • They change often, in the background, so set some sort of timer event to save at a particular interval.
    • They change often, but explicitly, so have some sort of “save changes” button for the user to click.

    The problem with saving on exit is that your changes may be lost when you have a bug that causes an unhandled exception. If your app is supposed to run in the background, this might happen more often than you think, especially while it is still in development/testing.

    I went with a “save on exit” strategy with a toy system-tray style app I wrote several years back, and regretted it. Explicit saves and/or interval saves would have been a much better option.

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

Sidebar

Related Questions

We have an ASP.NET application that uses Forms Auth. When users log in, a
We have an ASP.NET application running at a customer site that uses ActiveDirectory for
I have an ASP.NET application that uses a custom MembershipProvider to allow users to
I have a .NET application that uses a sqlite database. In the latest release
I have a .Net console application that uses a QueryString that connects to a
I have a ASP.NET web application that uses Themes. Inside the theme directory are
I am currently working on a VB.NET desktop application that uses .mdb (Access) database
I'm working on a web application that uses the ASP.NET 2.0 Membership and Roles
OK, so I have a .NET project that uses plugins. The plugins are implemented
I'm working on a multi-tenant ASP.NET MVC application. So far we have been using

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.