Today wrote a Windows service program, itself this program is a console application, but not able to run directly through F5, the following image shows the error:
It is suggested that a Instalutil.exe program needs to be installed to search the program online, which is a self-contained tool in the NET Framework.
1, open run input cmd, press ENTER, enter CD C:\Windows\Microsoft.NET\Framework\v4.0.30319, carriage return, and then enter InstallUtil.exe run the program, after running there will be some introduction
2. Enter the program service path that you want to install after entering InstallUtil, including the full name of the program, such as: F:\flight\blanceService\blanceService.exe carriage return
Attached to me after running:
At this point, execute the cmd command at the exe folder where the program is located.
The program will be run. You can see this program in Program Manager.
A preliminary exploration of Windows Service application