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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T17:59:55+00:00 2026-06-12T17:59:55+00:00

I’ve set up a WCF Library hosted in a Windows Service using the following

  • 0

I’ve set up a WCF Library hosted in a Windows Service using the following walk-through:

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

The consumer winforms is in the same solution, which is located locally on my work PC’s C: drive.

The walk-through works i.e. the winforms button gives me the correct answer.

If I create a new Solution on the C-Drive with a single Windows Forms project in it I cannot successfully add a service reference to this running service, i get the following message:

enter image description here

The detailed message says the following:

The URI prefix is not recognized. Metadata contains a reference that
cannot be resolved: ‘net.tcp://localhost:8526/Service1’. Could not
connect to net.tcp://localhost:8526/Service1. The connection attempt
lasted for a time span of 00:00:02.0020000. TCP error code 10061: No
connection could be made because the target machine actively refused
it 127.0.0.1:8526. No connection could be made because the target
machine actively refused it 127.0.0.1:8526 If the service is defined
in the current solution, try building the solution and adding the
service reference again.

Why can I add this Service Reference ok to a project within the same Solution as the Service but not from a project in a different solution?


EDIT

My colleague found an error in the MSDN article – I have detailed his find HERE

  • 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-12T17:59:56+00:00Added an answer on June 12, 2026 at 5:59 pm

    The step by step walkthrough article at MSDN ends unfortunately where it gets interesting, so let’s continue here. Because there are many possibilities which may cause the error, I’ve described several options (= scencarios which may cause the issue) below, which should help troubleshooting:

    1st option: Try to specify

      net.tcp://localhost:8526/Service1/mex
    

    when you add the service reference to your new client – ensure that the service is installed and running before you do that.

    Explanation: The suffix “mex” stands for “metadata exchange” and allows Visual Studio to download details of the WCF contract. This suffix is also used in the walk-through example, it was added automatically (you will see it in the Address field if re-open the added service reference by right-clicking on “Configure Service-Reference…”).


    2nd option: What I noticed when I tested the walk-through is that it helps sometimes to right-click on the service reference and select in the contect menu “Update Service-Reference”.

    After a while in the systray you can see the balloon message “Your service(s) have been hosted.”, after which you can start the client within the same solution. In this case, the service has been temporarily created but is not deployed permanently – which means, if you stop debugging, it is removed. As a result, you can’t use this service from a remote PC, it is just visible within the solution in Visual Studio. Visual Studio internally invokes the tool

    WcfSvcHost.Exe /Service:<Service1Binary> /Configuration:<Service1Config> 
    

    supporting it with the right parameters to register the service properly (you can find this tool in Visual Studio’s Common7\IDE subdirectory, and there is also WcfTestClient.Exe available – a tool which acts as a client, very useful to debug WCF).

    For instance, if you have stopped debugging, and launch the client.exe from Windows Explorer outside of Visual Studio, then it does not find the service and you’re getting exactly the error message you have described in your question.

    There are two interesting links regarding this matter at Microsoft:
    Problem with Metadata Exchange and Publishing Metadata

    Note that this is different from deploying it as described in the 3rd option.


    3rd option: Have you used InstallUtil to deploy the service? In this case it can happen that you have accidently removed the [...]/bin/Debug subdirectory and the service fails to start, because the .EXE file is missing.

    Note: This can be avoided if you’re using a ServiceInstaller project, which copies the binaries before the service is registered. Or – if you want to use InstallUtil for simplicity – you can copy the service binaries to a target directory (including the .config files and .dlls) before you register it.


    4th option: If you run the service on a remote computer, you need to specify the proper host name or IP address of the host instead of localhost, and you need to ensure that the personal firewall (windows firewall or 3rd party) doesn’t block the port 8526 (the port number which was used in the example). Specify an exception to allow this port for incoming and outgoing traffic.


    5th and final option (UPDATE): Naming conflict – Service1 is the service but also the class name in the Wcf library. Either fully qualify the class name you’re using from the WCF library in the service, i.e. WcfServiceLibrary1.Service1 or rename the class. Whytheq has found it himself with a colleague and as posted it here.


    More reading: Check out this article, which I’ve found recently: “WCF: a few tips“. It explains very well troubleshooting WCF. The only change I would made to the console hosting example is to replace the using statement by a

    ServiceHost host = new ServiceHost(typeof(Service));
    try
    {
        host.Open();
    
        Console.WriteLine("WCF Service is ready for requests." +  
        "Press any key to close the service.");
        Console.WriteLine();
        Console.Read();
    
        Console.WriteLine("Closing service...");
    }
    finally
    {
        if (host!=null) {
                host.Close();
                host=null;
        }
    }
    

    If you want to know more about the reason why, check out this article: “Proxy open and close“.

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

Sidebar

Related Questions

I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
We are using XSLT to translate a RIXML file to XML. Our RIXML contains
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out

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.