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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:49:49+00:00 2026-06-15T23:49:49+00:00

I have a Visual Stuido 2010 website project (not web application). I need to

  • 0

I have a Visual Stuido 2010 website project (not web application). I need to provide the ability to make a web service call, either ad-hoc from a website button or scheduled. So I create a c# library containing a WCF call to the target web service. I then add a reference to my library from the website. I am now able to call a public method on my library that then call the webservice – great!

My problem is, the website seems to insist on having the system.servicemodel web.config entries required for the call to the web service. Although this works, it means I have two places to maintain them – in the web.config of the client website and the app.config of my c# library. I have also created a c# console application (to trigger the web service call on a schedule) which references the library app, this too requires a copy system.servicemodel entries in its app.config. The same applies for connection strings.

Does anyone know if there’s an easy way to avoid this reliance on having duplicate web.config / app.config entries spread through various projects of the solution?

Thanks,Rob.

  • 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-15T23:49:50+00:00Added an answer on June 15, 2026 at 11:49 pm

    You could “externalize” your relevant config sections into separate files, and reference those from both app.config as well as your web.config.

    Any .NET configuration section can be stashed into an external config file, so you can write:

    <system.serviceModel>
      <bindings configSource="bindings.config" />
      <behaviors configSource="behaviors.config" />
      <client configSource="client.config" /> 
      ....
    </system.serviceModel>
    

    Now, your external files will look exactly like the relevant config section inside your config:

    bindings.config:

    <?xml version="1.0" encoding="utf-8" />
    <bindings>
       <basicHttpBinding>
           <binding name="......."  ...... />
       </basicHttpBinding>
    </bindings>
    

    Note: Visual Studio’s editor will complain about the configSource= attribute – but the Intellisense is mixed up – the configSource attribute is present on each configuration section, and it does work just fine!

    Note #2: you cannot externalize the entire <system.serviceModel> since that is a configuration section group – and those do not have any means to be put into external files, unfortunately.

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

Sidebar

Related Questions

I have a Website Project in Visual Studio 2010 along with a Class Library
I am using Visual Studio 2010 for an MVC website project. I have an
I have created my first website in Visual Studio 2010 Professional. In the web
I have a c# website project in visual studio 2010, and all of my
in Visual Studio 2010 I have a really big ASP.NET website project which has
I have a asp.net website with c# code behind and using visual studio 2010.
I have a Visual Studio 2010 C# project which creates an .exe and this
I have a .NET 4 Website (not application) in which I'm trying to use
I have a Visual Studio 2010 project with a Master Page that works fine.
I have deployed a website using Visual Studio 2010 on IIS6. I used one

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.