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

  • SEARCH
  • Home
  • 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 7588633
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T19:58:14+00:00 2026-05-30T19:58:14+00:00

No question I am yet to be hit by any read speed bottleneck. I

  • 0

No question I am yet to be hit by any read speed bottleneck. I am asking to know; if reading app.config frequently is a bad programming choice. I have known of database operations getting expensive.

In my case I am not reading my own application’s app.config, but of another project’s, like this:

private string GetAppConfigValue(string key)
{
    ExeConfigurationFileMap fileMap = new ExeConfigurationFileMap();
    fileMap.ExeConfigFilename = GetConfigFilePath();
    Configuration appConfig = ConfigurationManager.OpenMappedExeConfiguration(fileMap, ConfigurationUserLevel.None);
    return appConfig.AppSettings.Settings[key].Value;
}

Scenario: I have a manager class (and only one such class) where I have to read few values (3 to 4) from a config file specified by a physical path, but many times. Need I have few member variables to store the values from app.config file? What would be the best approach. Thanks.

  • 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-30T19:58:16+00:00Added an answer on May 30, 2026 at 7:58 pm

    I’m sure that all configuration files(web.config or app.config) are cached by default, so you don’t need to create a static class that holds all values or be afraid that the files are accessed permanently.

    Here is some reading:

    • Web.Config is Cached
    • ConfigurationManager.RefreshSection Method
    • Application Configuration Files Explained
    • ASP.NET Configuration Overview

    Regarding to your requirement to access another application’s config file:

    MSDN: “These methods(note: for client applications: ConfigurationManager.GetSection) provide access to the cached configuration values for the current application, which has better performance than the Configuration class.”

    In other words: Yes, you should cache it when it’s not your own app’s config file.

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

Sidebar

Related Questions

This is a simple question yet I was unable to find any information at
Yes, I know, yet another question about mutable objects. See this for general background
This is a very simple question yet I have little knowledge in Linux and
Please do not mark it as a dupe of this question just yet: Bold
Yet another PHP question. I've got two arrays: one string-based and the other numeric.
First question here: it is a very short yet fundamental thing in Java that
Question related to PHP memory-handling from someone not yet very experienced in PHP: If
My question pertaining to phonegap is simple and yet I cannot find an answer.
Fairly straight forward question but Googling hasn't turned up anything as yet. How do
I saw a similar question being posted here, yet it did not help me

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.