the core object of hosting service is ServiceHost,we can use  the following code to instantiate a ServiceHost:

using (ServiceHost host = new ServiceHost(typeof(MyService)))   
{       
               host.Open();
               Console.Read();  
}

the main purpose of this instance is to create ServiceDescription,the SericeHost and the ServiceDescription are the top 2 important object for the ServiceHost

after Opening serviceHost,many operations are done in the background automatically.

  1. validate serviceDescription
  2. group the endpoint according to the ListenUri and ListenUriMode
  3. Create ChannelDispatcher
  4. Create EndpointDispatcher
  5. Dispatch Behavior

a little map

WCF Note—ServiceHost

转载于:https://www.cnblogs.com/sanjia/archive/2011/03/10/wcf_servicehost.html

相关文章: