3

I am getting an issue to open the WCF service in browser with localhost:8733. it says that This site can’t be reached

localhost refused to connect.

Search Google for localhost 8733 Home Search Flight ERR_CONNECTION_REFUSED

Below is the configuration file is used in the console application which is the hosting the application

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="mex1">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service name="HelloIndigo.HelloIndigo" behaviorConfiguration="mex1">
        <endpoint address="HelloIndigo" binding="basicHttpBinding" contract="HelloIndigo.IHelloIndigo">


        </endpoint>
        <endpoint address="HelloIndigo" binding="netTcpBinding" contract="HelloIndigo.IHelloIndigo"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>

             <add baseAddress="http://localhost:8733/" />
            <add baseAddress="net.tcp://localhost:9000"/>
          </baseAddresses>
        </host>
      </service>
    </services>
  </system.serviceModel>
</configuration>

in the Host console application i am writing the below code

   ServiceHost host = new ServiceHost(typeof(HelloIndigo.HelloIndigo));

                host.Open();
                Console.WriteLine("Host is opened at " + DateTime.Now.ToString())

1 Answers1

2

Next day morning in the office, when I opened the project the same issue came up - "This site can’t be reached". As per my previous experience with this issue, I changed a port number and it started working. But this time, it didn't help. Then I tried another way (see screenshots below).

A problem:

a problem

Solution:

solution, step 1

enter image description here

This is the other way that works for me . I hope this will help who faces the same issue.

stop-cran
  • 4,229
  • 2
  • 30
  • 47
  • I imagine there are numerous causes of this error and this isn't a fix-all, but it definitely solved the issue I was having and saved me from Day 3 of pulling my hair out over why 1 service mysteriously stopped running. Thanks! – Derek Eatough Dec 17 '18 at 17:07