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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:29:33+00:00 2026-06-15T22:29:33+00:00

This question is a followon from my previous where I have since discovered that

  • 0

This question is a followon from my previous where I have since discovered that it is not working 100% on my computer: WCF service not running on non-dev machine

I’m working through this example:

http://msdn.microsoft.com/en-us/library/ff649818.aspx

It turns out that the InstallUtil step isn’t really working here. I’ve discovered that if VS2010 has the project open, and you go to add a service reference like in step 8 of the tutorial, VS2010 actually starts up the service host and therefore a reference is created.

Here’s how i’ve debugged so far:

  • Install the service as per InstallUtil, close down VS2010 solution; then open a completely different solution (TESTWCF) Try and add a service reference and it fails – cannot find at the specified address

  • Open WCFServiceLibrary1 project again as a separate instance of VS2010. Try and add a service reference to TESTWCF and it fails.

  • Within WCFServiceLibrary1, attempt step 8 – add a service reference. This causes the service host to start and the service is found.

  • With service host still running, in TESTWCF I then try and add service and it works.

  • Close down the service host and try and add reference in TESTWCF and it doesn’t work again.

This all seems to be totally independant of the service running or not running as installed by InstallUtil.

I’ve also verified this through the creation of a new virtual server from scratch and loading things on one by one. And only when VS2010 was installed did it start to work – when I observed above.

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-15T22:29:34+00:00Added an answer on June 15, 2026 at 10:29 pm

    Success ! After like 4 days of effort on this, the MSDN tutorial has a fatal flaw.

    In the first step of the tutorial you create a wcf service library and by default it names the service Service1. In step 2.6 of the tutorial you are asked to specify the base address:

    net.tcp://localhost:8523/Service1 
    

    Step 3 you are asked to create a new windows service, and by default this is also called Service1.

    In step 5.2 you are asked to make a reference to System.ServiceModel and to WcfServiceLibrary1.

    In step 5.6 you replace the Onstart Method to start the service and, Step 8 shows the final code as being:

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Linq;
    using System.ServiceProcess;
    using System.Text;
    using System.ServiceModel;
    using WcfServiceLibrary1;
    
    namespace WindowsService1
    {
    public partial class Service1: ServiceBase
    {
        internal static ServiceHost myServiceHost = null; 
    
        public WCFServiceHost1()
        {
            InitializeComponent();
        }
        protected override void OnStart(string[] args)
        {
            if (myServiceHost != null)
            {
                myServiceHost.Close();
            }
            myServiceHost = new ServiceHost(typeof(Service1));
            myServiceHost.Open();
        }
        protected override void OnStop()
        {
            if (myServiceHost != null)
            {
                myServiceHost.Close();
                myServiceHost = null;
            }
        }
    }
    }
    

    The crucial line of code which is wrong is:

            myServiceHost = new ServiceHost(typeof(Service1));
    

    Well it might behave differently in VS2008 or 2005 or maybe it’s a config in VS2010 however, my VS2010 interprets Service1 to be that of the containing class ie:

    WindowsService1.Service1
    

    Whereas it should in fact be:

    WcfServiceLibrary1.Service1
    

    I noticed that 4 days ago but figured I didn’t know enough about WCF and I was wrong somehow – esp when it appeared to work ’cause of VS2010 starting it up itself.

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

Sidebar

Related Questions

This is a follow-on from a previous question, in the implementation, I have two
This is a follow-on from a previous question ( here ), but I'm working
This is a follow on from my previous question although this is about something
This is a follow-on from a previous SO question Anchoring CSS Repeating Background Image
This question is a follow on from the following: UITouch - Event not responding
This is a follow on from another question i made I have this query
This is a follow-on from a previous question I had: How to decouple my
I have started this a new question as it became a follow-on from my
This is a slight follow on from a previous question: for(id <stuffieProtocol> eachObject in
This question is related to that one. But somewhat extended. Let's assume we have

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.