1

I have used the attach to process feature of visual studio a number of times. However now when i try to attach to a process (dll) the Attach button is disabled. However if i select any other process except the managed one the Attach button is enabled! My problem is closely related to the problem described at the link below

VS attaching to process disabled

A picture of the dialog is attached. Attach to process dialog

Community
  • 1
  • 1
Martin
  • 3,396
  • 5
  • 41
  • 67

2 Answers2

4

This is almost certainly 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.

Justin
  • 84,773
  • 49
  • 224
  • 367
  • Yup, vshost.exe is a major hint that this is the case. That's the name of the process when it runs in the Visual Studio hosting process. – Hans Passant Aug 30 '11 at 13:06
  • Thank You Justin, you were right about the process being attached to currently running instance of VS. Here i am running a C# application which invokes a win32 dll. I had put a MessageBox() function in the dll and as soon as the message box pops up i try to attach to the process, my goal being to debug the dll code. But How can i overcome this problem of being attached to VS... – Martin Aug 30 '11 at 13:19
0

Found the solution to the problem

How to step into C/C++ DLL from C# application while debugging

http://msdn.microsoft.com/en-us/library/605a12zt%28v=VS.90%29.aspx

Community
  • 1
  • 1
Martin
  • 3,396
  • 5
  • 41
  • 67