Kevin McPhail Kevin McPhail - 1 year ago 114
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?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download