Hosting
The WCF service class cannot exist in a void. Every WCF service must be hosted in a Windows process called the host process. A single host process can host multiple services, and the same service type can be hosted in multiple host processes. WCF makes no demand on whether or not the host process is also the client process, although having a separate process obviously promotes fault and security isolation. It is also immaterial who provides the process and what kind of process is involved. The host can be provided by Internet Information Services (IIS), by the Windows Activation Service (WAS) on Windows Vista or Windows Server 2008 or later, or by the developer as part of the application.
Tip
In-process (or in-proc) hosting, where the service resides in the same process as the client, is a special case. The host for the in-proc case is, by definition, provided by the developer.
IIS 5/6 Hosting
The main advantage of hosting a service in the Microsoft IIS web server is that the host process is launched automatically upon the first client request, and you rely on IIS 5/6 to manage the lifecycle of the host process. The main disadvantage of IIS 5/6 hosting is that you can only use HTTP. With IIS 5, you are further restricted to having all services use the same port number.
Hosting in IIS is very similar to hosting a classic ASMX web service. You need to create a virtual directory under IIS and supply an .svc file. The .svc file functions similarly to an .asmx file and is used to ...