Attach debugger onto another Visual Studio instance
Asked Answered
W

2

3

I'm doing some visual studio extension development in Visual Studio 2010. It would be useful to debug while developing so I have it configured to open another instance of VS when debugger for F5 ( http://donovanbrown.com/post/How-to-debug-a-Visual-Studio-Extension.aspx). This all works fine but is there a way to attach a debugger to an existing instance of VS2010, I have tried and the breakpoints aren't being hit. There are no errors but wondering if there is a way?

I should add I do know how to attach to a debugger and I have used it before to attach to ASP.net code.

Ween answered 13/10, 2011 at 16:8 Comment(0)
W
4

OK managed to solve it. What I was doing was when opening an instance of Visual studio, following the usual method, i.e. open a normal instance ( devenv.exe). What you have to is open a experiemental instance, using the parameters ( cmd line mode): /rootsuffix Exp

Then use the attach to debugger mode to attach to this instance.

Ween answered 17/10, 2011 at 13:38 Comment(1)
Note : I did have to do a full rebuild in certain instance where the debug symbols weren't loaded for some unknown reason.Ween
E
7

Under Debug there is a item called Attach to Process. This will do exactly what you want it to do. enter image description here

Use the Title column to tell which instance of devenv.exe you want to connect to (notice that I started the attach on BinaryFileSearch, but I am attaching to FixClientNoteRTF). enter image description here

It does not let you attach to yourself because if you hit a breakepoint the UI would stop responding and how would you tell it to step or continue?

Ergotism answered 13/10, 2011 at 16:15 Comment(6)
I'd love to get my hands on that autopunch.exe ;)Loo
I see what you mean but I have tried the same as mentioned to another instance and it didn't work, i.e the break points weren't being hit.Ween
There are plenty reasons to not hit breakpoints so do your research and ask separate questions. Most common - mismatched binaries ( check list of Debug->Window->Modules to see what is actually loaded) and wrong type of debugging (native/managed/script).Plusch
Alexi, I did do my research and aware of the type of debugging and had a look at that already. The reason a person asks a questions is because they don't know the answer to something, it doesn't mean he or hasn't already looked themselves for the answer already otherwise Stackoverflow will not exist. I haven't looked at the modules loaded yet and shall do that next. In the mean time, if anyone else has experienced and resolved the same issue then let me know.Ween
@Ween you did not say in your question that you did that. From your question (and especially your title) it appears that you did not know how to attach at all. You should open a new question with the title "Breakpoints are not hit when I attach to a running VS2010 instance" as that is your real problem, not knowing how to attach.Ergotism
Scott, I have edited the question to mention my experience with attach to debugger. However I think the title is fine, you misundertood it but there is enough detail in there for others.Ween
W
4

OK managed to solve it. What I was doing was when opening an instance of Visual studio, following the usual method, i.e. open a normal instance ( devenv.exe). What you have to is open a experiemental instance, using the parameters ( cmd line mode): /rootsuffix Exp

Then use the attach to debugger mode to attach to this instance.

Ween answered 17/10, 2011 at 13:38 Comment(1)
Note : I did have to do a full rebuild in certain instance where the debug symbols weren't loaded for some unknown reason.Ween

© 2022 - 2024 — McMap. All rights reserved.