Kevin McPhail Kevin McPhail - 6 months ago 30
C# Question

Visual studio Attaching debugger to windows service -- attach greyed out

I am trying to attach to a windows service using the Visual Studio 2010 --> Debug --> attach to process command. When i scroll through the list of processes my windows service is greyed out and the attcah button is also greyed out. I have tried changing the service account to loacal service, my account, etc but it remains greyed out. Anyone have any suggestions or anyway to troubleshoot this?


I usually have the same issue and I take care of it by adding a bool to my config that triggers a debug launch. You can launch a VS debugger instance that attaches to your win service process by calling this:


What's nice is you can call it wherever you wish in your code.