c# - Run a Windows Service as a console app -
i want debug windows service pops error message saying
cannot start service command line or debugger. windows service must installed using installutil.exe , started server explorer, windows services administrative tools or net start command.
i don't have idea error.....
before windows service can run, has "installed" first using installutil. eg:
c:\installutil -i c:\path\to\project\debug\service.exe
then can open list of services start it. eg:
- right click 'my computer'
- click on 'manage'
- open 'services , applications'
- click on 'services'
- find service in list , right-click on it
- click on 'start'
once has started, can go visual studio, click on 'debug', click on 'attach process'.
another technique add line onstart() method in service:
system.diagnostics.debugger.launch();
when that, it'll prompt pick instance of visual studio debug service in.
Comments
Post a Comment