How to debug the .NET Windows Service OnStart method?

One thing you could do as a temporary workaround is to launch the debugger as the first line of code in the OnStart

System.Diagnostics.Debugger.Launch()

This will prompt you for the debugger you’d like to use. Simply have the solution already open in Visual Studio and choose that instance from the list.

Leave a Comment