I have created one windows service which send an email notifications to users (list retrieved from db) every 2 minutes. I wish to check that everything is running ok in web service and hence I wish to debug the service. The service is installed in SMC (services.msc) when an server setup of application is done.
My question: how to debug the windows service?
I cannot see the service from
- Task Manager
- Attach to process
I have tried from following links
-
Debugging windows services (CANNOT understood the FIRST COMMENT- making normal windows form)
I have also given the rights of debugging from http://msdn.microsoft.com/en-us/library/aa291232%28VS.71%29.aspx#vxtskdebuggerpermissionsdebuggingasystemservice
Let me know if any input required.
Thanks!
EDIT: @maycil
I wrote your If(!Debug) code but I guess there is some problem as I don’t see proper color of Visual Studio.

try this code in Service1Companent.cs