using netTcpBinding in WCF

Posted by in WCF category on for Beginner level | Views : 62298 red flag
Rating: 5 out of 5  
 1 vote(s)

In this article we are going to use netTcpBinding in WCF.
In this article, we are going to use netTcpBinding in WCF. 

Advantages of using Net.Tcp are as follows:
         1) It can be used for high performance communication.
         2) Net.Tcp Port sharing service enables net.tcp port to be shared across multiple user processes.

Lets go through this application step by step


         In this application, we are going to use Console Application. Open VS2008>New>Project>Console Application>Select language as c#>give the name of the project.


       Give the Reference to System.ServiceModel. Now lets write our ServiceContract,OperationContract and so on.

It just prints the value whatever we enter.


         Now lets configure the app.config. I suggest you to use WCF Service Configuration Editor Tool. If you dont know how to use it then go through this article


        Now lets write the servicehost to our application.


         Now we are using a tool called svcutil. 
        You need to type in VS command Prompt like this
        svcutil /out:proxy.cs /config:app.config "http://localhost:8025/Service"
        It will generate proxy.cs and app.config.


        Now lets create a client application. New>Project>Console Application>give the name.
        Copy and paste the proxy.cs and app.config from the particular location and paste into client application.


        Now give a Reference to System.ServiceModel. Then write these of lines in the Program.cs


        Now lets run this application 

I hope you people like this application. Thank you.
Page copy protected against web site content infringement by Copyscape

About the Author

Full Name: anup hosur
Member Level:
Member Status: Member
Member Since: 8/1/2009 2:37:23 AM
Country: India
He is the .net developer with around 8 years of experience in technologies like c#, WCF, WPF and

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)