Installing the window service
installation command: InstallUtil.exe MyServiceLog.exe
InstallUtil exists path is: C:\WINDOWS\Microsoft.NET\Framework\. NET version number
Copy C:\WINDOWS\Microsoft.NET\Framework\ in the InstallUtil.exe to Bin/debug or Bin/release folder in the version number path, run the command directly in the Command line window
InstallUtil.exe MyServiceLog.exe, Register this service in the system and make it a suitable registration key, such as:
Then in the Window Service list, start the Myservicelog service service, then overwrite the original file with the new file, if the path changes, you should first uninstall the
Uninstalling the window service
command: InstallUtil.exe myservicelog.exe/u
If you modify the service, but the path does not change, you do not need to re-register the service, stop the service directly, and then reinstall the service.
Install and uninstall the Windows service Program