Home All Groups Group Topic Archive Search About

How to attach an exe to the debugger?

Author
18 Nov 2006 1:01 AM
rdufour
In Vs2005, I need to be able to single step through the application events
unhandledexception event. Just putting a breakpoint on a line of code in
there does not work because running the app in debug mode the unhandled
exception I throw for testing gets intercepted by the VS2005 IDE. Someone
suggested running the exe and attaching it to the debugger, but I can't seem
to find out how to do that.

Can anyone tell me how its possible to debug code in the application events
unhandledexception event. Exactly what are the steps needed to be able to do
that. I can't find any info on this in the docs.
Has anyone managed to do this before?

Any help would be greatly appreciated.
Bob

Author
18 Nov 2006 1:07 AM
Herfried K. Wagner [MVP]
"rdufour" <bduf***@sgiims.com> schrieb:
> In Vs2005, I need to be able to single step through the application events
> unhandledexception event. Just putting a breakpoint on a line of code in
> there does not work because running the app in debug mode the unhandled
> exception I throw for testing gets intercepted by the VS2005 IDE.

Check out "Debug" -> "Exceptions...".  You can configure how the IDE should
behave if an exception occurs there.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
18 Nov 2006 4:31 PM
Robert Dufour
Herfried could you please be more specific, I looked at that but I really
can't figure what setting to change.
I tried unchecking enable exception assistant, but then my app just quits on
unhandled exception which is not what I need. I also tried unchecking the
common language runtime exceptions, the app just terminates, there just
seems to be no way to get to a breakpoint in the unhandledexception event in
the applicationevents in Vs2005.
If anyone managed to do this I would really appreciate knowing how.

Bob
d K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
Show quoteHide quote
news:OuHD03qCHHA.2316@TK2MSFTNGP04.phx.gbl...
> "rdufour" <bduf***@sgiims.com> schrieb:
>> In Vs2005, I need to be able to single step through the application
>> events unhandledexception event. Just putting a breakpoint on a line of
>> code in there does not work because running the app in debug mode the
>> unhandled exception I throw for testing gets intercepted by the VS2005
>> IDE.
>
> Check out "Debug" -> "Exceptions...".  You can configure how the IDE
> should behave if an exception occurs there.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://dotnet.mvps.org/dotnet/faqs/>
Author
20 Nov 2006 2:29 PM
Chris Dunaway
rdufour wrote:

> exception I throw for testing gets intercepted by the VS2005 IDE. Someone
> suggested running the exe and attaching it to the debugger, but I can't seem
> to find out how to do that.

Run your .EXE.  In VS, choose Tools->Attach To Process.  Select your
..exe from the list.  Your breakpoints should now be hit.

If your exception occurs before you can attach the debugger, you might
have to put a Thread.Sleep or some other pause at the very beginning of
the code so that you have time to attach the debugger.
Author
20 Nov 2006 5:09 PM
Robert Dufour
Thanks,
Bob
Show quoteHide quote
"Chris Dunaway" <dunaw***@gmail.com> wrote in message
news:1164032989.212534.170390@m7g2000cwm.googlegroups.com...
> rdufour wrote:
>
>> exception I throw for testing gets intercepted by the VS2005 IDE. Someone
>> suggested running the exe and attaching it to the debugger, but I can't
>> seem
>> to find out how to do that.
>
> Run your .EXE.  In VS, choose Tools->Attach To Process.  Select your
> .exe from the list.  Your breakpoints should now be hit.
>
> If your exception occurs before you can attach the debugger, you might
> have to put a Thread.Sleep or some other pause at the very beginning of
> the code so that you have time to attach the debugger.
>