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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:15:04+00:00 2026-05-26T12:15:04+00:00

My current solution has 3 project with 2 app.config (one for common settings and

  • 0

My current solution has 3 project with 2 app.config (one for common settings and another for service settings). As of now I’m simply creating static classes to act as a mediator to access values. I do this so I don’t have to write ConfigurationManager.AppSettings["SomeKey"] everywhere. This works fine until you want to access an app.config file from a different project.

Here is what I’m currently doing (all properties omitted for brevity).

public class ServiceConfiguration
{
    public static readonly string SyncEvery = ConfigurationManager.AppSettings["SyncEveryMinutes"];
}

How can I access an app.config file located in another project? I thought perhaps setting VS to copy the file to the output directory would do the trick however my configuration object is still null.

  • 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-26T12:15:04+00:00Added an answer on May 26, 2026 at 12:15 pm

    I can’t imaging many good reasons to read another app’s configuration in the first place, it just opens a can of worms that isn’t worth dealing with.

    Expose a class that exposes the project’s configured values as properties, and access them from a consuming class.

    public class FirstProjectClass 
    {
      public static int SyncEveryMinutes
      {
          get { return (int)ConfigurationManager.AppSetting["SyncEveryMinutes"] };
      }
    }
    
    
    public class SecondProjectClass
    {
      public void ShowConfigedValue()
      {
          Console.Writeline("Syncing every {0} minutes", FirstProjectClass.SyncEveryMinutes);
      }
    }
    

    if you’ve got complex configuration requirements you can also look into custom configuration sections

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

Sidebar

Related Questions

My current solution for renaming the project folder is: Remove the project from the
I have a simple rails app with models project and phase. A project has
I have a requirement on my current project (a Flex app which will be
I'm using two tables for my current project(it will grow certainly). First table has
Here's the current layout: Solution: Core Domain Interfaces DataAccess Providers Session Service UI UnitTests
I have a solution in VS 2010: a WCF Service Library project (NotifyService) and
We have a Visual Studio 2008 solution with 58 projects. One project targets the
I have a Windows forms project (VS 2005, .net 2.0). The solution has references
Wondering if anyone has a solution to this 2010 bug. I have a project
In a current project we are hosting a WCF 3.5 service on IIS7 and

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.