Select the ServiceProcessInstaller1 component, view the properties, set account to LocalSystem
Select the ServiceInstaller1 component to view the properties
Sets the value of the servicename that represents the name in the system service
Set StartType, if manual is started manually, by default stop, if automatic for auto start
Set description, Add service description
Enter CD C:\Windows\Microsoft.NET\Framework\v4.0.30319 carriage return
To switch the current directory, it is important to note that in the C:\Windows\Microsoft.NET\Framework directory there are many similar versions, specifically to which directory to see the project's operating environment, for example, the result is. NET framework2.0 need to input CD C: \ windows\microsoft.net\framework\v2.0.50727
Input InstallUtil.exe E:\TestApp\Winform\WinServiceTest\WinServiceTest\bin\Debug\WinServiceTest.exe Carriage return
Description: E:\TestApp\Winform\WinServiceTest\WinServiceTest\bin\Debug\WinServiceTest.exe represents the exe file location for project generation
Uninstall is simple, open cmd, direct input SC delete winservicetest can
Regedit deleting the registry can also
C#window Service creation and deletion