How to Debug a Windows Service written in C# ?

Debugging a Windows Service is one of the difficult thing to do when working on developing a Windows Service project in Visual Studio .

One of the method to do the debugging is to attach the debugger to the thread and starting the Windows Service. . This might be little overhead sometimes.

How to Debug a Windows Service written in C# ?

Incase you need to debug the windows service quickly , you can use the Debugger.Break() method which will immediately take you to Visual Studio .

Debugger.Break();
%d bloggers like this: