C#.Net Windows Service debugging and logging

By | October 20, 2014

C# .Net Windows service which can run in background at regular intervals. This code sample highlights two things. One, it shows how easy it is to bootstrap a windows service with little code. Second, how to debug a windows service. Debugging .Net windows service is a little tricky business. One easy way as shown below is to rely on conditional code symbols and invokes Debugger.Launch which automatically attaches a debugger when service starts up.