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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T13:32:37+00:00 2026-06-06T13:32:37+00:00

When reading our configuration and resource files, our .Net system currently just does ConfigurationManager.AppSettings[keyToFind]

  • 0

When reading our configuration and resource files, our .Net system currently just does ConfigurationManager.AppSettings["keyToFind"] or similar and merrily goes on its way, assuming that it found what it was looking for. When we add new config we need to remember to add it to the config files manually and runtime issues are not always easy to track down if (when!) we forget.

So I thought of adding a small class as a single gateway for reading our app.config and .resx files. My first attempt simply does the same thing then checks for nulls and throws an exception, logs an error or sets a default, where appropriate, if something is not found. It works fine but I’m wondering if I’m re-inventing the wheel. Also, as far as I know I can’t make the app.config only available through this class, is that correct? So future devs are free to ignore my solution!

Is there a better (i.e., built-in or accepted standard) way of dealing with missing fields in the config files?
I’m also looking at templating the config files with T4 for consistency but I’d like a runtime check as well.

  • 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-06-06T13:32:39+00:00Added an answer on June 6, 2026 at 1:32 pm

    I think this is certanly already done by many others (including me) work, but it’s not that much to bother. Just do that you need for your case and forget.

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

Sidebar

Related Questions

In our system we are reading user security groups from an Active Directory in
I am currently looking into OCR solutions to implement into our software. After reading
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
I'm currently successfully reading out several properties on our switches over SNMP with php.
We have a folder where our app will be potentially reading, writing and creating/deleting
So we've upgraded our site from 3.5 SP1 -> .NET 4. When we ran
I was reading through our code base at my company and I saw something
Our team is currently using some ported code from an old architecture to a
After reading a question here about what things our computer could do in one
Our CMS allows users to enter text using a html editor, so when reading

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.