Simple debugging of Windows Services
So, you are writing a windows service. You want to debug it when it starts. How do you attach the debugger in time? I’ve seen lots of examples where people have implemented a Thread.Sleep() method during start-up to allow them enough time to attach to the service process. While this works it is pretty messy.[…]