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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:53:31+00:00 2026-05-17T01:53:31+00:00

I have an extension method which uses some configuration settings. I’ve declared these as

  • 0

I have an extension method which uses some configuration settings. I’ve declared these as static.

public static class Extensions
{
    static string _mailServer = ConfigurationManager.AppSettings["MailServer"];
    // ... etc    

    public static void SendEmailConfirmation(this IOrder order) { }
}

I just wanted to check that this is doing what I intend as I’m not 100% sure. The idea is that I don’t want to have to keep reading these values, I’d like them to be read once and cached for the lifetime of the web application. Is this what will happen? 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-17T01:53:31+00:00Added an answer on May 17, 2026 at 1:53 am

    (updated with KeithS’s clarification that they aren’t read until first used)

    They will be read the first time they are used, and then retained until the AppDomain is stopped or recycled, which is probably what you want.

    That is, ASP.NET apps run inside an AppDomain. This is how they are resident and available to multiple requests without having to startup for each individual request. You can configure how long they live and when they recycle, etc. Static variables live and die with the app and thus will survive as long as the app is resident in the app domain.

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

Sidebar

Ask A Question

Stats

  • Questions 542k
  • Answers 542k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer To give some context since it's not entirely clear from… May 17, 2026 at 3:10 am
  • Editorial Team
    Editorial Team added an answer Properly escape your data that should be displayed unparsed in… May 17, 2026 at 3:10 am
  • Editorial Team
    Editorial Team added an answer It very rarely matters for speed purposes unless you're Google.… May 17, 2026 at 3:10 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have created an extension method called AddGZip which looks like the following: public
I'm going to develop a Firefox extension which uses some Java classes. The extension
I have written an extension method in csharp for an MVCContrib Html helper and
Possible Duplicate: What Advantages of Extension Methods have you found? All right, first of
I have two sequences (of tuples) on which I need to do a join:
I have a situation where i want to add LinePragmas to CodeDom objects. But
I want to load some images into my application from the file system. There's
I am trying to create a simple 3-D app for android that will have
Greetings StackOverflowians, As discovered here , Windows 7 features a bug in which the
I have developped an asmx webservice with visual studio and I deploy on IIS

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.