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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:21:30+00:00 2026-06-14T15:21:30+00:00

I have created a WCF service, basically it does some interaction with my database.

  • 0

I have created a WCF service, basically it does some interaction with my database.
The service is in a project, and it calls functions from a library that i created in another project.
In my library, which i will call WCFSerivceLibrary i also have an app.config which i want to pull out some stored values in the AppSettings section.

The issue is that when i call my WCF service from a certain client, and a function is executing in the WCFServiceLibrary, whenever i call AppSettings it checks the configuration
file for the calling client!

Further Explanation :
lets say we have a windows forms application which calls my WCF service this way :

MyWCFService.DoWork();

in the function DoWork in my WCF service i have the following code :

Type DoWork ()
{
  //MyWCFServiceLibrary is a library in the same solution of the WCF Service.
  MyWCFServiceLibrary.DoWorkOne(); 
  MyWCFServiceLibrary.DoWorkTwo();
}

In the functions DoWorkOne or DoWorkTwo… I’m calling on AppSettings to get some values stored in the app.config of MyWCFServiceLibrary project, but instead, on execution the AppSettings are loaded from the app.cofing of my windows forms client calling the WCF service.

  1. How to avoid the mentioned issue above?
  2. Can I have a single configuration file for my WCF Service and the service library?
  3. How to share it between both?
  • 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-14T15:21:31+00:00Added an answer on June 14, 2026 at 3:21 pm

    I’m writing below what I meant about copying the configuration. But I don’t think that this is the problem. The problem is probably that you’re not even doing WCF communication. I suspect that you included the DLL both in the service project and the client project and you’re simple calling the methods on class from the client.

    Do do WCF communication you need to have the WCF service running (for example an EXE that creates a ServiceHost with an endpoint). Then in the client, you add a service reference by using Visual Studio’s “Add service reference” menu item.

    There’s no need to include the DLL in the client, as classes will be generated automatically to access the service via WCF.

    Now for using application settings properly:

    Copy the application settings of your DLL’s app.config file to the app.config file of the executable project that’s using the DLL. For example, this could then look like this:

    <?xml version="1.0"?>
    <configuration>
        <configSections>
            <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
                <section name="Executable.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
                <section name="DLL.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />        
            </sectionGroup>
        </configSections>
    
      <applicationSettings>
          <Executable.Properties.Settings>
              <setting name="Test" serializeAs="String">
                  <value>Testvalue EXE</value>
              </setting>
          </Executable.Properties.Settings>
          <DLL.Properties.Settings>
              <setting name="Test" serializeAs="String">
                  <value>Testvalue DLL</value>
              </setting>
          </DLL.Properties.Settings>
        </applicationSettings>
    </configuration>
    

    After doing that, the application can access its settings through Properties.Settings.Default.Test (which returns Testvalue EXE) and the DLL can access its settings through Properties.Settings.Default.Test (which returns Testvalue DLL).

    I don’t understand why people need to use things like ConfigurationManager when it is actually that simple…

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

Sidebar

Related Questions

We have created a WCF service hosted in a windows service that handles Authentication
I have a Data Service created using WCF that internally uses nHibernate. This WCF
I have created an Ajax enabled WCF web service that contains this simple method:
I have created a WCF service interface and implementation in a Class Library. I
I have created a WCF service which does not use the app.config to configure
I want to Use Some Java Code From the WCF Service. Basically I need
I have created a WCF service that uses windows authentication and would like to
I have created a WCF Service Library in VS2010 and can run the service
I have created a WCF service, but the service WSDL does not show my
I have created a WCF service for uploading images , which accepts System.IO.Stream 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.