Groups | Blog | Home
all groups > dotnet myservices > december 2004 >

dotnet myservices : How to debug a service onstart event ? (c# service & vs2003)


Sagaert Johan
12/9/2004 4:55:23 PM
Hi

I use the debug ->attach command to debug the Onstop or other events while
the service to debug is already running.

Problem : how can i debug the Onstart ; the service must be running before i
can attach to the executable .
So by the time i have made the debuugger attach to the service, i am way to
late ...

Is there no way to have to debugger wait till the service process is started
?

Johan


Lee Gillie
12/12/2004 7:58:13 AM
You can include a line of code at the beginning of OnStart to invoke the
debugger. I am trying to remember, but I think VB.NET "Stop" does that,
but IRRC there is perhaps also a method on the Debug object? Invoking
JIT is documented well.

[quoted text, click to view]
anonymous NO[at]SPAM discussions.microsoft.com
1/4/2005 2:07:58 AM

[quoted text, click to view]
Praveena
1/10/2005 2:34:21 PM
In case you haven't gotten your answer yet.. It is "Stop"
statement that you would code in OnStart and build the
project after you do that for Debugger to pick it. When
you start service next time, code is interrupted and stop
statement provided.


[quoted text, click to view]
AddThis Social Bookmark Button