8

I want to use netTCPbinding, so I've changed my web config as below. I'm experiencing this error:

Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].

How can this be solved?

<services>
  <service name="DXDirectory.DXDirectoryService" behaviorConfiguration="DXDirectory.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="netTcpBinding" bindingConfiguration="WindowsSecured" contract="DXDirectory.IDXDirectoryService">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <host>
      <baseAddresses>
        <add baseAddress="net.tcp://localhost:2582/DXDirectoryService" />
      </baseAddresses>
    </host>

  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="DXDirectory.Service1Behavior">
      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="false" />
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false" />
      <serviceAuthorization principalPermissionMode="UseWindowsGroups" />
      <!--<serviceCredentials>-->
        <!--<userNameAuthentication userNamePasswordValidationMode="Custom"
                                membershipProviderName="CustomUserNameValidator"/>-->
      <!--</serviceCredentials>-->
    </behavior>
  </serviceBehaviors>
</behaviors>
p.campbell
  • 98,673
  • 67
  • 256
  • 322
Ashish Ashu
  • 14,169
  • 37
  • 86
  • 117
  • Want to know much more about NetTcpBinding in WCF... Visit this link it has lots of information.. http://www.planetofcoders.com/nettcpbinding-in-wcf/ – Gaurav Agrawal Aug 14 '13 at 13:09

3 Answers3

5

HMm... you've added the base address to your services/host section ok.

Quick question: are you self-hosting, or hosting in IIS ?? Which version of IIS ??

IIS5/6 only support HTTP connections - you cannot host a NetTCP in IIS 5/6.

In IIS7, you have to manually go through a series of steps to enable non-HTTP bindings, but it's possible. See this MSDN article on how to achieve this.

Self-hosting is the best option - you get all bindings and are in total control of your service being hosted.

Marc

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
4

Here is a NetTcpBinding basic example from msdn. See if this can help you.

EDIT:

And here is a related SO question.

Community
  • 1
  • 1
Ezombort
  • 1,892
  • 3
  • 16
  • 20
0

I cant see section in your config file, can u please please add this

<netTcpBinding>

 <binding name="WindowsSecured">
 <security mode="none"/> 
 </binding> 

</netTcpBinding>

Ajay Kelkar
  • 4,591
  • 4
  • 30
  • 29