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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T16:06:27+00:00 2026-06-15T16:06:27+00:00

.net 4.0 I have two web projects using their own web.config file and using

  • 0

.net 4.0

I have two web projects using their own web.config file and using the same endpoints to call the same WCF web service.

Both use a common project (dll) which has an app.config file. I would like to move the endpoint info into that config file – is this possible? I want endpoint information

<client>  
    <endpoint/> 
<client/> 

to be shared by both web app from common place?

Web.config file binding info omitted here

<?xml version="1.0" encoding="utf-8"?>
<configuration>
   <system.serviceModel>
      <bindings/>          
      <client configSource="client.config">
   <system.serviceModel/>
</configuration>

client.config file within common project

 <client>
      <endpoint
        name="endpoint1"
        address="http://localhost/ServiceModelSamples/service.svc"
        binding="wsHttpBinding"
        bindingConfiguration="WSHttpBinding_IHello"
        behaviorConfiguration="IHello_Behavior"
        contract="IHello"/ >

Apology for typo two things i changed
1. client.config had a element took that out.
2. within the build properties of project added COPY “$(TargetDir)*.config” “$(ProjectDir)”

Just to mention both in web.config (configSource)& client.config VStudio shouts design time but runs fine?

  • 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-15T16:06:28+00:00Added an answer on June 15, 2026 at 4:06 pm

    You can share parts of the WCF config by “outsourcing” it:

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

    and then have this content in your client.config:

    <?xml version="1.0" encoding="utf-8"?>
    <client>
        <endpoint name="ABC"
            address="http://......."
            binding="......."
            contract="......" />
    </client>
    

    You cannot put stuff into the app.config of a common assembly, since those config files will not be used / looked at by the .NET framework. You need to put your info into the main config file of the app or web site (web.config) – but you can “externalize” certain sections into separate, external files and sharing them like that.

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

Sidebar

Related Questions

I have two projects in my solution   1- asp.net web project.   2-
i have two .net web application and they ara running on different domain same
I have two applications Web Socket and Web Service created in .Net/Web Form and
i have two projects Evolet.Domain and Evolet.Web in my solution where Evolet.Web is asp.net
I have two projects in the same solution. One is an ASP.NET MVC 2
I have two ASP.NET MVC web applications. One of them logs unhandled exceptions to
I have two ASP.NET sites (they can not run in the same process) and
I have two different .Net projects, hosted on github. I would like to create
I have a pretty big web application that I created last year using ASP.NET
I've been using ASP.NET (C#) for the past two years. I have learned so

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.