Wednesday, March 07, 2007

Debugging .net windows service

Ever faced by the challenge of debugging windows service autmatically. These lines of code below in the main routine of your windows service will help you break in to the debug mode. This is pretty helpful when you want to debug and test your win service without actually deploying it on the box as well.

static void Main()
#if (!DEBUG)
ServiceBase.Run(new WindowsService());
ServiceBase.Run(new WindowsService());

Check the MS site for step by step debugging win service...

Credits - Swati for bringing this to my attention! :)
Thanks - Dipesh

No comments: