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

  • Home
  • SEARCH
  • 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 6015103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T02:47:16+00:00 2026-05-23T02:47:16+00:00

I have a solution in VS2010 with 3 projects: WCFServiceLib – a project created

  • 0

I have a solution in VS2010 with 3 projects:

  • WCFServiceLib – a project created with the WCF Service Library template.
  • ServiceHostConsole – a project created with Console Application template.
  • ServiceClientConsole – a project created with Console Application template.

The VS template created an app.config in the WCFServiceLib that contains all the settings for the services I want to expose.
The ServiceHostConsole has WCFServiceLib as a reference and hosts the service but does not have it’s own app.config file.
If I try to run the host project without an app.config, it fails to host the services, so I moved the app.config from the WCFServiceLib to the ServiceHostConsole.

The ServiceClientConsole has a Service reference to a service inside WCFServiceLib. But once I move the app.config from the Lib project to the Host project, I can no longer Update Service Reference or add new services that I added to the lib project.
In order for the client project to see the service references I have to move the app.config back to the lib project, do the updates/additions to the service references on the client, and then move the app.config back to the host project.

Note that I cannot leave a duplicate app.config file in both the Service Lib project and Host project as this will cause the host to also fail to start. This would be a bad solution anyway as it would create duplicate config in different places. A change to just one of them could create issues that are difficult to track.

It seems very strange that this moving around of the app.config file needs to happen to make things work for both the host and the client, and that they can’t both work at the same time.
I’m sure this must be an issue with the way I set things up (although I set them up with the default templates), and I guess there must be a better way to solve this.

This problem becomes very annoying when you are actively developing the services and need to constantly run the host and test the client with the updated services, hence the title of the question:

How do you maintain a WCF Service Library in VS2010 for both a Host and Client projects?

  • 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-23T02:47:16+00:00Added an answer on May 23, 2026 at 2:47 am

    WCF service library creates a config because it is used by a tool called WcfServiceHost.exe. This tool hosts your service if you try to test it without your own hosting application and based on your description it also hosted the service when you added a service reference in the client (because of that you cannot update the reference when you move the config from the library). The config in the library is never used by a hosting application and it doesn’t collide with a config used by the hosting application.

    A hosting application always needs its own config and there should be no problem to have a config in both the host and the library. You should not create a service reference from the library itself. Once you have your own host use it when you add service reference and maintain only the config in the host.

    There is one little problem. To add service reference the service must run. If both the client and the host are part of the same solution you must run the service without debugging (or outside of visual studio) to be able to add service reference to the client.

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

Sidebar

Related Questions

I'm developing WinForms application using VS2010. I have about 15 projects in the solution.
I have a C# solution in VS2010 that contains three projects. This solution has
Greetings! I have a solution in VS2010 that defines 3-4 individual applications. These 3-4
I have a solution file that has the following example projects: SharedLibrary NonSharedLibrary WebProject
I have just upgraded a solution with two web deployment projects from VS 2008
I have to create a small asp.net-application. The last such web-application I have built
i'm compiling a .net 3.5 solution with msbuild with this line of code: msbuild.exe
I am trying to integrate IronPython in my Silverlight application but am unable to
I recently started at a new position where the project is being developed using
I need a very weird thing I admit. I hope you'll be able to

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.