Women in Technology

Hear us Roar



Article:
  Debugging Windows Services
Subject:   Yet another way
Date:   2003-10-11 19:10:02
From:   blowery
The author's method doesn't really fix the problem with debugging code in the OnStart method of a service. You have to return from the method inside of 30 seconds, not just delegate to another function. After attaching the debugger, you're rarely going to have enough time to debug.


A better way is to use QueueUserWorkItem from System.Threading.Thread. You can delegate off your initialization code to a ThreadPool thread and enter the debugger there. Your OnStart method returns nice and quick and you can easily debug your application init logic from the other thread.


Crufty, but it works.

Full Threads Oldest First

Showing messages 1 through 2 of 2.

  • That should be
    2003-11-21 09:15:25  anonymous2 [View]

    System.Threading.ThreadPool.QueueUserWorkItem

    Check the framework documentation for details.
  • Yet another way
    2003-11-19 01:53:15  anonymous2 [View]

    Is there any sample code that demonstrates this method?

    thnx