Introduction
In this article, we will see how to create a simple WCF service. Then we will see how to host this WCF service in a console application with so called self-hosting. After that we will see how to expose service metadata via MEX endpoint. After that we will see how to create a proxy for the WCF service which has net.tcp and net.pipe endpoints using visual studio 2010.
Background
This article is all about creating, hosting and adding service reference to WCF service in client application. We will start with creating a WCF service as a class library, and then we will host it in a console application. We will expose net.pipe and net.tcp endpoints for our service. In WCF, when we add service reference via visual studio, visual studio will automatically create proxy for WCF service at client side. With basic settings, we cannot add service reference to WCF service which exposes net.tcp and net.pipe endpoints via visual studio. We will make necessary changes on WCF service so that visual studio can detect service and can add service reference to our client project.