ServiceHostFactory provides the base implementation for the factory that allows application code to participate in the creation of service hosts in managed hosting environments where the host instance is created dynamically in response to incoming messages. This is useful when hosting the service which requires some initialization data, depending on the requested .SVC page. For example, you have a service which maintain customer data for one mandator. To enable this you could use different .SVC files for each mandator: service1.svc and service2.svc. Now in SVC file you could specify the database connection string for target mandator.
In usual case the SVC file would look like:
In this case the BusService is the service implementation.
However, following code snippet shows the content of one SVC file, which configures the custom host:
<%@ServiceHost language=c# Debug="true" Factory="MyCustomHost" Service="Data Source=DADO-NB1;Initial Catalog=ServiceBusEventing;Integrated Security=True"%>