问题
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!
![](https://www.eimg.top/images/2020/03/06/9905f768bbfa7b0b38f7a36e5eb4ea32.png)
回答1:
Where it says
![](https://www.eimg.top/images/2020/03/06/75cedca06782e0c5c92d2505ab961642.jpg)
you should press 'Select' and ensure at least managed is ticked. (or choose automatic)
![](https://www.eimg.top/images/2020/03/06/90221d666620f944afcba0823229fc5d.jpg)
otherwise, the 'Attach' button will be disabled.
回答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.
回答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.
回答4:
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.
来源:https://stackoverflow.com/questions/5529476/vs-attaching-to-process-disabled