You cannot debug or run a service application by pressing F5 or F11; you cannot immediately run a service or step into its code. Instead, you must install and start your service, and then attach a debugger to the service's process as follows;
- Install your service and start the service.
- Open the project in Visual Studio 2005.
- Place your breakpoints at appropriate places in your code.
- Choose "Attach to process" from the Debug menu.
- From the available processes, look for the process created by your service. The process name will be same as the executable file of the service. (If not, choose both options "Show processes from all users" and "Show processes in all sessions")
- After clicking on "Attach" you should be able to debug your service application.