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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:44:22+00:00 2026-05-28T05:44:22+00:00

I have one problem. I have made solution and it is 3-tier application. So

  • 0

I have one problem.
I have made solution and it is 3-tier application. So I have 3 projects that are class libraries and one is windows form application which will use me to start all of that and connect them together. Problem is I have for data layer app.config file. If I put it in that dll then I can’t read it. If I put it in main program (windows form application) I am still not able to read it.

So my question is where to put app.config file so I can read it normally? I am reading it from DLL. It has to be that way because it is 3.tier app and all layers are on their own. So one is data layer, buisness logic and presentation layer.

Please help.

EDIT:

okay I’ll pass some code:

so I am reading from data layer app.config file like this:

SqlConnection konekcija = new SqlConnection(ConfigurationManager.AppSettings["skripta"]);

app.config file in that class library project is:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0"/>
  </startup>
  <appSettings>
    <add key="skripta"
           value="Data Source=DENONTH-PC;Initial Catalog=rups;Integrated Security=True;Pooling=False" />
  </appSettings>
</configuration>

I have app.config in that class librabry and in Windows form project and still nothing is referencing it properly.

  • 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-28T05:44:23+00:00Added an answer on May 28, 2026 at 5:44 am

    Usually I have one app.config per project, but real values are kept in the main (usually UI) application’s config. Then I create some Core/Utility project and there I create one class that’s responsible for exposing configuration keys/values. The Core/Utility project has no dependencies, but can be (and is!) referenced by any project that needs config values. It gives me a really simple layer of abstraction if one day I would like to switch to e.g. database driven configuration.

    So in the end: put everything in windows forms config. It should be absolutely reachable from the class library if using ConfigurationManager class.

    Edit#1:
    first of all if you want to store and use connection string, do it properly, which means:
    in the app.config:

    <connectionStrings>
        <add name="ConnString" connectionString="server..."/>
    </connectionStrings>
    

    in code:

    ConfigurationManager.ConnectionStrings["ConnString"];
    

    Try now. I’m pretty sure you’re doing something wrong because your code should be working.

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

Sidebar

Related Questions

I have made a swings application but there is one problem in that which
The problem: we have one application that has a portion which is used by
Here's my problem: I have an unmanaged dll that I made.I'm calling one of
I have a system that has three applications (one windows application and two web
I'm almost finished with my program, but I have one problem that I can't
Today I faced a strange problem. I have an application which is the same
I made a form with ajax email validation. My problem is that I need
I have a solution in Visual Studio 2010 that is made up of 3
I have a small problem but couldn't find solution for that. I have founded
I have made a control which has a property that is calculated by using

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.