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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:14:04+00:00 2026-05-15T05:14:04+00:00

I’m looking at some code that uses the .NET System.Configuration.SettingsProvider and ApplicationSettingsBase to handle

  • 0

I’m looking at some code that uses the .NET System.Configuration.SettingsProvider and ApplicationSettingsBase to handle configuration.

We have a class that derives from SettingsProvider that uses a database as the data store, and then we have other settings classes that inherit from ApplicationSettingsBase, and have the [SettingsProvider(typeof(MySettingsProvider))] attribute.

The problem is that we’re using these settings classes in multiple applications, but they seem to permanently cache the configuration values, the first time they are loaded. The issue is that if a setting is changed in one application, the other applications will not get the setting until the next restart, because they are cached everywhere.

My question is: is there a way to force the SettingsProvider implementation, or the classes derived from ApplicationSettingsBase to not cache values, and re-query the datastore every time the setting is accessed? A valid answer might be that these classes were not intended to be used in multi-application environments…

  • 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-15T05:14:04+00:00Added an answer on May 15, 2026 at 5:14 am

    Settings objects based on ApplicationSettingsBase only interact with the persistence mechanism/SettingsProvider on instantiation, Save or Reload operations. The rest of the time, it’s just working off the hashtables in the settings object.

    There’s a few ways to get the behaviour that you want.

    First, you could implement those non-cacheable properties manually, rather than rely on the persistence mechanism. You can do this in a partial class that is a companion to your normal vs.net generated settings class. If you implemented your own settings class, you don’t need the partial class, and you can just tack on the property. The drawback of this approach is that every read on that setting, will incur a db hit.

    Alternatively, if you need read caching, yet allow for change across applications. In ApplicationSetttingsBase.Save, which you can override, you could use a publish/subscriber mechanism that allows you to notify all the subscribers to refresh their through ApplicationSetttingsBase.Reload.
    This is much more involved, and depending on requirements, you may need to worry about keeping the state of your settings objects consistent.

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

Sidebar

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.