Building WCF service applications using method 1: Self-hosting administratively using an application configuration file
Having created an application configuration file, open an instance of the service and add the specified code to your application.
Before you begin
About this task
- Instantiate and open an instance of the service in the service host. The service type must be the same as the service type specified in the service configuration file.
- Add the following code to your application:
ServiceHost service = new ServiceHost(typeof(MyService)); service.Open(); ... service.Close();