Operations for Windows Services
I. Creation of services:
1. New Project--windows Service
2. This is a mistake that everyone will make, after you create a new project, press F5 (run), you will see the following error:
3. There are many ways to install the service, which is installed by means of an external tool:
4. The Installservice service appears in the VS Toolbar drop-down menu:
5. The following error occurs when clicking Run Installservice in:
This is the 3 diagram, the parameters are not caused by the. exe, so be sure to note that TimeWindowsService.exe
6. There are no errors caused by the installer:
7.service1.cs design page, right-add Installer:
8. After adding the installer, the ProjectInstaller.cs file is created:
9. Set Properties:
10. Installation success: Then the cmd command can operate the service;
CMD command: net start service name
11. In Windows Task Manager, you can see the service you just created:
Operations for Windows Services