By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,647 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

How to attach an exe to the debugger?

P: n/a
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

Nov 18 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"rdufour" <bd*****@sgiims.comschrieb:
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/>

Nov 18 '06 #2

P: n/a
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]" <hi***************@gmx.atwrote in message
news:Ou**************@TK2MSFTNGP04.phx.gbl...
"rdufour" <bd*****@sgiims.comschrieb:
>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/>

Nov 19 '06 #3

P: n/a
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.

Nov 20 '06 #4

P: n/a
Thanks,
Bob
"Chris Dunaway" <du******@gmail.comwrote in message
news:11**********************@m7g2000cwm.googlegro ups.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.

Nov 20 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.