I have written a windows service application which is installed on my PC. There is a problem with it, so I want to debug that service.
Can you tell me how to debug the windows services?
I have written a windows service application which is installed on my PC. There is a problem with it, so I want to debug that service.
Can you tell me how to debug the windows services?
The easiest way to debug code that you've written as a service in .NET is to separate all the functional code from the service into a separate assembly and then create another project, as a console or WinForms application that uses the separate assembly to run the service code.
The easiest way is to add System.Diagnostics.Debugger.Launch() to the point you want to start debugging. Visual Studio will need to be running as Administrator. When the code is executed, a dialog will pop up asking which instance of Visual Studio you want to use to debug. If you've got Visual Studio already open with the relevant project loaded, choose that one.