Windows Services – Debugging Trick

I’ve been writing a windows service in VS 2005 for a client and wanted a slick way of debugging it without having to change the code to much.

What I came up with is probably not an original idea but I like it enough I thought I would share it.

Protected Overrides Sub OnStart(ByVal args() As String)
#If DEBUG Then
System.Diagnostics.Debugger.Launch()
#End If
End Sub

This causes the Visual Studio debug window to pop up and ask you which VS session to debug from when the service starts and allows you to debug it till your hearts content.

Windows Vista User Account Control Step by Step Guide

I loaded Windows Vista as soon as it was posted on MSDN. I like it a lot but I couldn’t stand the constant confirmation of everything I did. The UAC is the piece that is supposed to keep your mom from doing something stupid. But for a guy like me that never doesn’t anything stupid I feel as though I really don’t need it. This article is a great explanation of UAC.

BTW, to turn off UAC go to Control Panel | User Accounts | Turn User Control on or off.

Read the full technet article here: