Debugging windows service

We can not debug windows service directly like .net web application and windows application. Then what to do? don't worry, we have a work around to debug windows service.

  1. In Program.cs Change the main method code like console application
  2. In Visual studio Attach the service to debug

We will discuss about the two ways in our following articles.