Simon Harriyott

Debugging a service in .NET

To debug a service in .NET, put

System.Diagnostics.Debugger.Break();

in the OnStart method. This will fire up a prompt when run, which is where the debugger can be selected.
6 December 2005