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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T14:36:01+00:00 2026-05-11T14:36:01+00:00

Configuration settings in 3.5 is driving me nuts… Help! ;) I have a class

  • 0

Configuration settings in 3.5 is driving me nuts… Help! 😉

I have a class library (Named ADI), that needs some configuration settings from the project using it (like connectionstring, filesystem locations etc).

I want to define these settings in my Windows Forms/Web Projects App.Config or Web.Config, like other settings.

Here is part of my app.config for my windows forms application:

<applicationSettings>     <PhotoImportRobot.My.MySettings>       <setting name='ADIImageRoot' serializeAs='String'>         <value>C:\DataTemp\ADI\Original\</value>       </setting>       <setting name='ADIImageVariantsRoot' serializeAs='String'>         <value>C:\DataTemp\ADI\Variants\</value>       </setting>     </PhotoImportRobot.My.MySettings> </applicationSettings> 

How do I access that from my class library??

I tried this:

System.Configuration.ConfigurationManager.AppSettings('ADIImageVariantsRoot') 

What to do?

  • 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. 2026-05-11T14:36:02+00:00Added an answer on May 11, 2026 at 2:36 pm

    If you’re not after structured settings, the appSettings section just takes key-value pairs:

    <appSettings>   <add key='ADIImageRoot' value='C:\DataTemp\ADI\Original\' />   <add key='ADIImageVariantsRoot' value='C:\DataTemp\ADI\Variants\' /> </appSettings> 

    This will enable you to access them via the AppSettings dictionary:

    ConfigurationManager.AppSettings['ADIImageVariantsRoot'] 

    As you would expect.

    Alternatively, if you need more structure to your configuration (i.e. more than just strings, or a collection of settings), you can look into using a configuration section of your own, using a ConfigurationSection, and its relevant parts.

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

Sidebar

Related Questions

I have a C# class library A which has some configuration settings in its
I have an app that has some configuration settings stored in SharedPreference. Now I
I currently am writing a web app that needs to pass some configuration settings
I have an initializer that loads configuration settings from a yaml file. I need
I have a dynamic class that serves as a storage container for configuration settings.
I have a windows application that uses an assembly that stores some configuration settings
I have a web application with over 200 configuration settings. These control everything from
HI, I want to have set configuration settings for a unit test project that
I have an app that contains configuration settings that should be changed only by
I have an extension method which uses some configuration settings. I've declared these as

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.