Every now and then we work with window service for integration of our CRM project. As far as debugging is concern, windows service is pain. Let see simple method to debug a windows service.
1. This is the three line of code you are going to use to debug the service.
2. Go to Program.cs
3. Put this code inside static void Main() method.
4. Build the windows service in debug mode and install it using installuti.exe.
5. Open windows service project while starting windows service.
6. On start of windows service it would ask you to debug the service. Select the windows service project. Now would be in world of debugging windows service.
Thus you can start the debugging of windows service.