Windows Communication Foundation services can be hosted in many different ways. Up until this chapter, all the examples have either hosted the service in IIS or a Windows forms application. But that is just the "tip of the iceberg" because WCF services can also be hosted in a traditional Windows service and a Windows Process Activation Service. For those familiar with .NET Remoting technologies, using Windows services and IIS (itself a Windows service) for a host should appear familiar.
Hosting a WCF service refers to the environment that the service exists and operates in. There are two primary hosting modalities:
Self-hosting, which means that you will build the host environment yourself
Hosted, which means that you will use a built-in hosting environment such as IIS
This chapter discusses the many different hosting scenarios in which to host a WCF service. In particular, this chapter covers the following hosting topics:
Hosting versus self-hosting
Available hosting options
Windows Communication Foundation services are designed to run in any process that supports managed code, including NT services, traditional EXEs, as well as the aforementioned Windows Process Activation Service (WAS). The great thing about this is that the code for your service will look the same regardless of the hosting environment because of the unified programming model that WCF provides for building service-oriented applications.