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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T00:48:39+00:00 2026-05-19T00:48:39+00:00

I created a WCF service and Hosted it through console. but when I created

  • 0

I created a WCF service and Hosted it through console. but when I created another Web Application and tried to add it service reference its give error

Metadata contains a reference that
cannot be resolved:
‘net.tcp://192.0.0.0:9100/ConsoleApplication3/Communicator.svc/mextcp’.
Could not connect to
net.tcp://192.0.0.0:9100/ConsoleApplication3/Communicator.svc/mextcp.
The connection attempt lasted for a
time span of 00:00:00.9843750. TCP
error code 10061: No connection could
be made because the target machine
actively refused it 192.0.0.0:9100.
No connection could be made because
the target machine actively refused it
192.0.0.0:9100 If the service is defined in the current solution, try
building the solution and adding the
service reference again.

Here is code:

namespace ConsoleApplication3
{
class Program
{
    static void Main(string[] args)
    {
        try
        {
            using (ServiceHost host = new ServiceHost(typeof(Communicator)))
            {
                host.Open();
                Console.WriteLine("Press <Enter> to terminate the Host application.");
                Console.ReadLine();
            }
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex.Message);
            Console.ReadLine();
        }
    }
 }

[ServiceContract]
public interface ICommunicator
{
    [OperationContract]
    string SayHello();
}

public class Communicator : ICommunicator
{
    public string SayHello()
    {
        return "I am here";
    }
}

And here is the configuration:

    <configuration>
  <system.serviceModel>
    <services>
      <service name="ConsoleApplication3.Communicator" behaviorConfiguration="CommunicatorBehavior">
        <!-- Service Endpoints -->
        <endpoint address="ConsoleApplication3" binding="netTcpBinding"
            contract="ConsoleApplication3.ICommunicator"/>
        <!-- This Endpoint is used for genertaing the proxy for the client -->
        <!-- To avoid disclosing metadata information, set the value below to false and
       remove the metadata endpoint above before deployment -->
        <endpoint address="mex" contract="IMetadataExchange" binding="mexTcpBinding" />
        <host>
          <baseAddresses>
            <add baseAddress="net.tcp://localhost:9100/"/>
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="CommunicatorBehavior">
          <serviceMetadata httpGetEnabled="false"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>
  • 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-19T00:48:40+00:00Added an answer on May 19, 2026 at 12:48 am

    I think you got a wrong address to try and get at your service.

    You have hosted a service yourself in a console app, with netTcpBinding, and you’ve defined a base address of net.tcp://localhost:9100/, and the MEx endpoint is at net.tcp://localhost:9100/mex.

    So you need to use either the base address

    net.tcp://localhost:9100/
    

    or the MEX address

    net.tcp://localhost:9100/mex
    

    when trying to connect to the service.

    I don’t know how you came up with this address (net.tcp://192.0.0.0:9100/ConsoleApplication3/Communicator.svc/mextcp) that you seem to try to connect to – but this address is not valid. First of all – there’s no *.svc file to be used when self-hosting a netTcpBinding webservice, and I don’t know where you got this /mextcp address from…..

    Update: I took your code, created a new console app with the interface and service implementation and your service config, and it works just fine on my machine:

    alt text

    I did get a warning from Windows Firewall when I tried to launch the console app from within Visual Studio about allowing access – which I did allow.

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

Sidebar

Related Questions

I have a WCF service hosted at IIS7 web application. It's created by a
I created a WCF Service, Hosted it in IIS and created a web application
So I've created a WCF service application and hosted it on IIS7. It currently
Using Visual Studio 2010, I developed a WCF service hosted on a web application
I have created a reference to an IIS hosted WCF service in my ASP.NET
I have a Web application and a WCF service hosted on the same Windows
I have a .NET, WCF web service (created in PowerBuilder 12.5.1) hosted on an
We have created a WCF service hosted in a windows service that handles Authentication
I've created a Wcf Service to back a Ajax page (.Net 3.5). It's hosted
I created a WCF service in Windows Azure project (with 1 WCF Service Web

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.