Click here to Skip to main content
14,690,191 members
Articles » Web Development » Wiki.ASP.NET articles » General
Posted 25 Sep 2010


1 bookmarked

Hosting WCF Service with netTcpBinding on IIS7

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
1 Nov 2015CPOL
Hosting a WCF Service with netTcpBinding on IIS7

This articles was originally at but has now been given a new home on CodeProject. Editing rights for this article has been set at Bronze or above, so please go in and edit and update this article to keep it fresh and relevant.

I hosted my WCF service with wsHttpBinding as well as netTcpbinding. While I hosted with netTcpBinding on IIS 7 I have considered the following things, hope it will be useful for others also.

Web.Config should have following configuration settinggs to hosting WCF service on IIS7(WAS):

        <binding name="tcpbinding" portSharingEnabled="true">
            <security mode="None"></security>
            <!--<security mode="Transport">
              <transport clientCredentialType="Windows" protectionLevel="EncryptAndSign"/>
              <message clientCredentialType="Windows"/>

Trouble Shooting on IIS7.*

If following exception gets thrown while adding service reference:

Error: Cannot obtain Metadata from net.tcp://win-2008:9002/Multibinding/Service1.svc
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.
For help enabling metadata publishing, please refer to the MSDN documentation at
Exchange Error
URI: net.tcp://win-2008:9002/Multibinding/Service1.svc
Metadata contains a reference that cannot be resolved: 'net.tcp://win-2008:9002/Multibinding/Service1.svc'.
Could not connect to net.tcp://win-2008:9002/Multibinding/Service1.svc. The connection attempt lasted for a time span of 00:00:02.0374439. TCP error code 10061: No connection could be made because the target machine actively refused it.
No connection could be made because the target machine actively refused it

Step 1: Make sure following services are enabled for net.tcp:

  • Net.Tcp Listener Adapter
  • Net.Tcp Port Sharing Service

If not then enable and start both services.

Step2: IIS Manager -> Select Hosted service -> Action pane -> Advance setting ->

See Enable Protocol, by default http protocol there, need to specify net.tcp with comma separated

Step3: Make sure your application pool is running in classic mode

Image 1

Step4: Right click on Default Website -> Edit bindings

Make sure net.tcp protocol information there

Image 2

Step5: Check firewall, Create Inbound and outbound rule for port which we are using.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

ASP.NET Community
United States United States
The ASP.NET Wiki was started by Scott Hanselman in February of 2008. The idea is that folks spend a lot of time trolling the blogs, googlinglive-searching for answers to common "How To" questions. There's piles of fantastic community-created and MSFT-created content out there, but if it's not found by a search engine and the right combination of keywords, it's often lost.

The ASP.NET Wiki articles moved to CodeProject in October 2013 and will live on, loved, protected and updated by the community.
Group type: Collaborative Group

758 members

Comments and Discussions

-- There are no messages in this forum --