17

A few days ago, the attach button in "Attach to process" dialogue became disabled in VS 2010 and VS 2008 likewise. At first I thought that it is just an extension I've installed in VS 2010 but then I noticed it is the same in VS 2008. The both VS's a re running in administrative mode and on Windows 7. I looked around but I can't seem to find a solution to this. If anybody has encountered an similar problem, a little help would do great. Thanks upfront.

EDIT: Attached a picture of the dialogue!

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
Drakche
  • 395
  • 1
  • 4
  • 11
  • Try checking both the "Show processes from all users" and "Show processes in all sessions" checkboxes. – Cody Gray - on strike Apr 03 '11 at 13:15
  • 1
    What is the qualifier name? ie, are you attempting to debug on your own machine? perhaps post a screenshot of your attach to process dialog. – wal Apr 03 '11 at 13:45
  • I'm trying to attach to local IIS instance, it's IIS 6.0 in question. Also I can't attach to Localhost either, not to a smartphone emulator. Although the debug works when hitting F5. – Drakche Apr 03 '11 at 13:53

4 Answers4

30

Where it says enter image description here

you should press 'Select' and ensure at least managed is ticked. (or choose automatic) enter image description here

otherwise, the 'Attach' button will be disabled.

wal
  • 17,409
  • 8
  • 74
  • 109
  • Thanks, I can't believe that I didn't notice such an obvious thing. – Drakche Apr 03 '11 at 14:47
  • 2
    no probs. dont be too hard on yourself; i dont think greying out that box is very nice either; validation on pressing 'attach' would be nicer. – wal Apr 03 '11 at 14:56
3

It could also be because there is already another debugger attached to the process - probably the currently running instance of Visual Studio but it may be another instance of Visual Studio, or another debugger entirely (such as WinDbg or a remote debugging session).

Check the "Processes" window (usually found under Debug -> Windows -> Processes) to see what processes Visual Studio is debugging.

Try stopping Visual Studio but don't close the process.

wesley.mesquita
  • 795
  • 5
  • 12
live-love
  • 48,840
  • 22
  • 240
  • 204
2

I have come across a weird situation under which Attach button was disabled. This was because of DebugDiag. Please refer the following thread for info.

Jav_Rock
  • 22,059
  • 20
  • 123
  • 164
0

I was trying to debug a windows service as described here and had the same issue. The solution was to run Visual Studio as Administrator and select to see processes from all users.

Gökhan Kurt
  • 531
  • 5
  • 13