How to attach an exe to the debugger?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rdufour

    How to attach an exe to the debugger?

    In Vs2005, I need to be able to single step through the application events
    unhandledexcept ion 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
    unhandledexcept ion 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



  • Herfried K. Wagner [MVP]

    #2
    Re: How to attach an exe to the debugger?

    "rdufour" <bdufour@sgiims .comschrieb:
    In Vs2005, I need to be able to single step through the application events
    unhandledexcept ion 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/>

    Comment

    • Robert Dufour

      #3
      Re: How to attach an exe to the debugger?

      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 unhandledexcept ion event in
      the applicationeven ts in Vs2005.
      If anyone managed to do this I would really appreciate knowing how.

      Bob
      d K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
      news:OuHD03qCHH A.2316@TK2MSFTN GP04.phx.gbl...
      "rdufour" <bdufour@sgiims .comschrieb:
      >In Vs2005, I need to be able to single step through the application
      >events unhandledexcept ion 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/>

      Comment

      • Chris Dunaway

        #4
        Re: How to attach an exe to the debugger?

        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.

        Comment

        • Robert Dufour

          #5
          Re: How to attach an exe to the debugger?

          Thanks,
          Bob
          "Chris Dunaway" <dunawayc@gmail .comwrote in message
          news:1164032989 .212534.170390@ m7g2000cwm.goog legroups.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.
          >

          Comment

          Working...