Sign In/My Account | View Cart  

advertisement

AddThis Social Bookmark Button

Article:
  Debugging Windows Services
Subject:   It's not either/or, it's both
Date:   2004-03-02 10:26:49
From:   amatlock
Response to: It's not either/or, it's both

I know this thread is pretty old, but I thought that I'd comment in case someone stubles across this looking for help.


I think that a combination of several approaches is optimal. I agree that the only way to accurately ensure that the code is going to execute properly is to debug it running as a service like kez_higgins says. I also spawn a new thread to execute my start up code like blowery mentions.


However, I take one more step and add a conditionally executed DEBUG block of code that causes the new thread to sleep for 10 seconds. This gives me enough time to attach to the process and step through the startup code if necessary.