1. Open the solution attached here . 2. Add a new project > select Windows service from Visual C# > Windows template 3. Name it WinSrvHost and click OK 4. Go to the code view of Service1.cs, notice that you have been provided with a template that you can start working with. Notice that this class is derived from the ServiceBase class. 5. In the design view, go to property change the name and service name to ProdSrvHost. 6. Add reference to System.Servicemodel and ProductServiceLibrary project. 7. Create a ServiceHost, by add the following code: ServiceHost host = new ServiceHost(typeof(ProductService)); 8. Override OnStart() method of ServiceBase Add the following code host.Open(); //use the one in the example 9. Override OnStop() method of ServiceBase Add the following code host.Close();//use the one in the example 10. Copy app.config from console host. Note that service metadata behavior is enabled (httpGetEnabled=true). 11. Add an install...
Education for everyone!