How do you debug a windows service that is being installed?
- by Mike Pateras
I know how to attach a debugger to a windows service, but I can't seem to get attached to one that's being installed and started by a windows installer. I've tried:
Setting a Thread.Sleep(TimeSpan.FromSeconds(30)); at the beginning of the on-start, but when I try to attach in Visual Studio, the name of the service does not appear as an option. This normally works, the service's name shows up in the list, but when using the installer it does not.
Setting a Debugger.Break and Debugger.Launch. Neither really do anything.
What can I do to debug my service?