How do you debug a windows service that is being installed?

Posted by Mike Pateras on Stack Overflow See other posts from Stack Overflow or by Mike Pateras
Published on 2010-04-09T00:03:05Z Indexed on 2010/04/09 0:23 UTC
Read the original article Hit count: 361

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:

  1. 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.

  2. Setting a Debugger.Break and Debugger.Launch. Neither really do anything.

What can I do to debug my service?

© Stack Overflow or respective owner

Related posts about debugger

Related posts about visual-studio