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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:35:14+00:00 2026-05-18T22:35:14+00:00

i am having a classlibrary with app1.config and also a windows application with app2.config;i

  • 0

i am having a classlibrary with app1.config and also a windows application with app2.config;i am adding the reference of classlibrary in windows application as well as app1.config.is it possible if i call the method class lib it will go to app1.config otherwise it will use app2.config;

  • 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-18T22:35:14+00:00Added an answer on May 18, 2026 at 10:35 pm

    The best you can achieve is to have two separate configuration files, then have the code of one method read the “main” config file (using the ordinary ConfigurationManager.AppSetting[""] code) and other method read the configuration file of the class library using such code:

    Configuration config = ConfigurationManager.OpenExeConfiguration(dllFilePath);
    KeyValueConfigurationElement element = config.AppSettings.Settings[appSettingKey];
    string value = element.Value;
    

    This will read application setting from the config file of DLL sitting in the location of dllFilePath.

    You can also have separate section for the class library in the “main” configuration file if relevant I can give sample as well.

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

Sidebar

Related Questions

I had a C# .NET windows application having C# user interface and all the
I'm having a class library which is getting referenced in a web application. This
I'm curious about the possibility of having a .NET class library that provides a
Having the following class: public class SomeClass { private readonly int[] _someThings; public SomeClass()
Having an assembly which I cannot modify (vendor-supplied) which have a method returning an
I am working on a class library and am having some trouble with generics.
I'm having a problem with assembly references. I have four assemblies: A class library
I'm having trouble with a gradient drawing call. I have a Form that looks
Having two projects: one is a class library (a .dll assembly) and the other
I have a Windows Service that overrides the OnStart and OnStop methods to call

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.