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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T11:57:23+00:00 2026-06-02T11:57:23+00:00

I am trying to host a WCF service on a windows 2008 R2 server

  • 0

I am trying to host a WCF service on a windows 2008 R2 server as a windows service. I followed the directions provided by msdn (found here). Everything works fine as long as everything is part of the same solution in visual studio. However, I tried creating a client in a different solution (on the same machine) and it can’t find the service. I get an ‘Add Service Reference Error’ shown below.

enter image description here

My goal is to be able to access the wcf service remotely, but I can’t seem to even access it locally unless the client was created within the same client. Is there any guides, tutorials, or helpful hints that anyone can give me to get this to work?

Update:
It seems that even though the windows service is running, the WCF service doesn’t seem to be listening to any ports. Which would suggest that it isn’t running. This also explains why everyone’s first thought I didn’t have the service running. I had assumed that since the windows service was running and that the same solution client worked, that the WCF service was working as well. Turns out that Visual Studio was starting up a WCF service whenever I ran the same solution client.

So, why isn’t the windows service starting the WCF service? Any ideas?

  • 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-02T11:57:24+00:00Added an answer on June 2, 2026 at 11:57 am

    It turns out that there was a problem with the tutorial provided by MSDN (provided in the question above). They named both the windows service and the WCF service Service1 which is the default name for both of them.

    The windows service was suppose to start the WCF service, however, it was actually trying to start itself again because both services had the same name.

    myServiceHost = new ServiceHost(typeof(Service1));
    

    To fix this problem, you can rename one of the services or fully qualify the WCF service when referenced in the windows service.

    myServiceHost = new ServiceHost(typeof(WcfServiceLibrary1.Service1));
    

    The funny thing is that the code provided still looks like it works because Visual Studio is smart enough to notice that the WCF service isn’t running and it starts an instance up behind the scenes.

    It was a simple bug to fix, but because Visual Studio was hiding the problem from me, I don’t think I would have found it without the help from Espen Burud.

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

Sidebar

Related Questions

I'm trying to host a WCF Service inside a Windows Service which I am
When trying to host my WCF service using Net Tcp channel through Windows Console,
I am trying to host a WCF service, using NetTcpBinding in a Windows service.
I'm trying to host a WCF service in IIS7 that works with both Silverlight
I have Windows Server 2008 R2 with IIS7 on it. I deployed WCF service
I am trying to host a WCF web service in IIS using Windows Authentication.
WCF newbie here... I'm trying to self-host a WCF service using NetTcpBinding. Based on
I am trying to host a WCF service on a windows service.Basically WCF service
I am trying to host WCF serviec in managed Windows Service. Basically i have
I have a WCF service. I am trying to host the service in a

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.