Debugging a service is not just a matter of pressing F5. You must attach the debugger to the running service, and you can only attach it after the service is started. Especially if you want to debug the code at the beginning of the CheckURLs() method, you'll find it helpful to slow the code down a little by inserting this line at the very top of the function:
This causes the service to pause for two minutes, which should be long enough for you to attach to the process. Set a breakpoint on the line immediately after this one, stop the service, and build it. Then move quickly to attach to the process, as follows :
If more time elapses than the pause you added, try setting a breakpoint on this line:
Control should reach this line once per second, giving you a chance to step through the loop. If you need more time to attach the debugger, stop debugging, stop the service, change the line of code that sleeps the service so that it sleeps longer, and repeat the attachment steps.
Once the debugger is attached to the service, you can do everything you normally would do: step through code, examine variables , and most importantly, see error messages and exceptions. When your service is not attached to a debugger, messages directed to the user (such as exception dialog boxes) are not shown; there is no one to show them to. When you are debugging, you see these messages. This should dramatically ease the difficulty of getting a more complex service working.