0

I saw a similar problem on the site, but I checked my base address and did not notice any problems. When start debugging my project, i got this exception:Only an absolute URI can be used as a base address.

My Host Application

private ServiceHost _presenterServiceHost;
public void Start()
{ 
if(_presenterServiceHost !=null)
                    _presenterServiceHost.Close();
                _presenterServiceHost=new ServiceHost(typeof(Business.FXCTSPipeConnectionsProvider));
                _presenterServiceHost.Open();
}

Contract Implementation

public  class FXCTSPipeConnectionsProvider:IFXCTSPipeConnectionsProvider
    {
      public string Request(string query)
      {
         var response= Container.Get(query);
          return response;
      }
    }

Contract

[ServiceContract(Name ="FXCTSPipeConnectionsProvider")]
   public interface IFXCTSPipeConnectionsProvider
   {
        [OperationContract]
       string Request(string query);
   }
}

App Config

<system.serviceModel>
    <services>
      <service name="FXCTSPipeConnectionsProvider.Business.FXCTSPipeConnectionsProvider" behaviorConfiguration="ServiceBehavior">
        <endpoint address="" binding="netNamedPipeBinding" contract="FXCTSPipeConnectionsProvider.Business.IFXCTSPipeConnectionsProvider" />
        <endpoint address="mex" binding="mexNamedPipeBinding" contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="net.pipe://localhost:9011/FXCTSPipeConnectionsProvider" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="ServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
          <serviceThrottling maxConcurrentCalls="50" maxConcurrentInstances="20" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
Uğur Can
  • 154
  • 2
  • 14
  • Possible duplicate of [Only an absolute URI can be used as a base address](http://stackoverflow.com/questions/30809971/only-an-absolute-uri-can-be-used-as-a-base-address) – Seano666 Apr 05 '17 at 18:29

1 Answers1

1

Just remove the port number and change the URL to: net.pipe://localhost/FXCTSPipeConnectionsProvider

ˈvɔlə
  • 9,204
  • 10
  • 63
  • 89
Rock
  • 26
  • 1