Debugging Windows Service

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear:

I created a windows service and I need to debug it , can anyone tell me how
can I debug It?
I tried to attach the process using visual .net (Tools->Debug
Process->Select my process then attach) when I place a breakpoint it will
have (?) not loaded.

any ideas?
 
Hi Raed,

I do not understand the problem you state at the end. What will not have
loaded?

Normally, you should install the debug-version of the service program. Along
with pdb-information, the debugger can allow you to debug your code.

Although I have never really debugged a service from .NET (IIRC), I think
the way you did it, is the way it should be done. After .NET debugger
attached to the process you can place the breakpoints in code. If the service
is a debug-version then that should work.

Can you verify that you are using the debug version of your service program?
Did you place breakpoints before or after you attached? Perhaps you should
do it only after the debugger attached to the process.

HTH,
Tom T.
 
I meant by not loaded that when I placed the breakpoint into my code the
breakpoint shape has question mark(?) though I attached the process.
But as u pointed out the problem I was using the release version not debug
version.
It works now.

Thanks
 
Back
Top