capturing crash

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

    capturing crash

    How can I capture the events leading to my windows application crashing?
    would a big try catch around the Application.Run () do the job? in my head
    that launches a thread and if that thread crashes somehow my try catch wont
    do crap, maybe im wrong.
    So what do you guys do to capture a possible application crash?


  • Muscha

    #2
    Re: capturing crash

    It won't catch your unhandled exceptions. But you can do something like
    this:


    MyExceptionHand ler handler = new MyExceptionHand ler();

    Application.Thr eadException += new ThreadException EventHandler(ha ndler
    ..Application_U nhandledExcepti on);

    Application.Run ( new Form1());

    And in MyExceptionHand ler just create a method with this signature:
    public void Application_Unh andledException (object sender,
    ThreadException EventArgs e)


    HTH,
    /m

    "cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
    news:%23VGCPMyo DHA.2848@TK2MSF TNGP10.phx.gbl. ..[color=blue]
    > How can I capture the events leading to my windows application crashing?
    > would a big try catch around the Application.Run () do the job? in my head
    > that launches a thread and if that thread crashes somehow my try catch[/color]
    wont[color=blue]
    > do crap, maybe im wrong.
    > So what do you guys do to capture a possible application crash?
    >
    >[/color]


    Comment

    • memememe

      #3
      Re: capturing crash

      thank you very much, that is exactly what I was looking for.

      "Muscha" <muscha@no.spam .net> wrote in message
      news:et8dkS2oDH A.2444@TK2MSFTN GP09.phx.gbl...[color=blue]
      > It won't catch your unhandled exceptions. But you can do something like
      > this:
      >
      >
      > MyExceptionHand ler handler = new MyExceptionHand ler();
      >
      > Application.Thr eadException += new ThreadException EventHandler(ha ndler
      > .Application_Un handledExceptio n);
      >
      > Application.Run ( new Form1());
      >
      > And in MyExceptionHand ler just create a method with this signature:
      > public void Application_Unh andledException (object sender,
      > ThreadException EventArgs e)
      >
      >
      > HTH,
      > /m
      >
      > "cs" <[rem]casolorz[rem]@hot[rem]mail.com> wrote in message
      > news:%23VGCPMyo DHA.2848@TK2MSF TNGP10.phx.gbl. ..[color=green]
      > > How can I capture the events leading to my windows application crashing?
      > > would a big try catch around the Application.Run () do the job? in my[/color][/color]
      head[color=blue][color=green]
      > > that launches a thread and if that thread crashes somehow my try catch[/color]
      > wont[color=green]
      > > do crap, maybe im wrong.
      > > So what do you guys do to capture a possible application crash?
      > >
      > >[/color]
      >
      >[/color]


      Comment

      • Rakesh Namineni[MSFT]

        #4
        RE: capturing crash

        If you have a VisualStudio IDE then a simple way is

        Attach the VisualStudio debugger to your application. And after that select
        Debug->Exceptions (Ctrl+Alt+E). Then you can
        select from a range of exceptions that you would want the debugger to
        track. And every time an exception is thrown and if it is the type you are
        interested then the debbuger will break at the point where the exception is
        being thrown. If you are not sure about what exception to capture you can
        "check" the top level "Common Language Runtime Exceptions" and your
        debugger will break for all the exceptions that are encountered.

        --------------------[color=blue]
        >From: "cs" <[rem]casolorz[rem]@hot[rem]mail.com>
        >Subject: capturing crash
        >Date: Tue, 4 Nov 2003 16:33:25 -0600
        >Lines: 7
        >X-Priority: 3
        >X-MSMail-Priority: Normal
        >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
        >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
        >Message-ID: <#VGCPMyoDHA.28 48@TK2MSFTNGP10 .phx.gbl>
        >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
        >NNTP-Posting-Host: ppp-67-64-23-92.dsl.wchtks.s wbell.net 67.64.23.92
        >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
        >Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.csharp:1967 51
        >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
        >
        >How can I capture the events leading to my windows application crashing?
        >would a big try catch around the Application.Run () do the job? in my head
        >that launches a thread and if that thread crashes somehow my try catch wont
        >do crap, maybe im wrong.
        >So what do you guys do to capture a possible application crash?
        >
        >
        >[/color]


        Rakesh, EFT.

        This posting is provided "AS IS" with no warranties, and confers no rights.
        Use of included script samples are subject to the terms specified at
        Use these online forms to report copyright and trademark infringement to Microsoft Legal. Infringement notices must comply with the Digital Millennium Copyright Act.


        Comment

        • memememe

          #5
          Re: capturing crash

          thanks but I actually wanted to capture these exceptions on product rather
          than on development.

          "Rakesh Namineni[MSFT]" <rakeshna@onlin e.microsoft.com > wrote in message
          news:wgVmmY9oDH A.1548@cpmsftng xa06.phx.gbl...[color=blue]
          > If you have a VisualStudio IDE then a simple way is
          >
          > Attach the VisualStudio debugger to your application. And after that[/color]
          select[color=blue]
          > Debug->Exceptions (Ctrl+Alt+E). Then you can
          > select from a range of exceptions that you would want the debugger to
          > track. And every time an exception is thrown and if it is the type you are
          > interested then the debbuger will break at the point where the exception[/color]
          is[color=blue]
          > being thrown. If you are not sure about what exception to capture you can
          > "check" the top level "Common Language Runtime Exceptions" and your
          > debugger will break for all the exceptions that are encountered.
          >
          > --------------------[color=green]
          > >From: "cs" <[rem]casolorz[rem]@hot[rem]mail.com>
          > >Subject: capturing crash
          > >Date: Tue, 4 Nov 2003 16:33:25 -0600
          > >Lines: 7
          > >X-Priority: 3
          > >X-MSMail-Priority: Normal
          > >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
          > >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
          > >Message-ID: <#VGCPMyoDHA.28 48@TK2MSFTNGP10 .phx.gbl>
          > >Newsgroups: microsoft.publi c.dotnet.langua ges.csharp
          > >NNTP-Posting-Host: ppp-67-64-23-92.dsl.wchtks.s wbell.net 67.64.23.92
          > >Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP10.phx.g bl
          > >Xref: cpmsftngxa06.ph x.gbl[/color][/color]
          microsoft.publi c.dotnet.langua ges.csharp:1967 51[color=blue][color=green]
          > >X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.csharp
          > >
          > >How can I capture the events leading to my windows application crashing?
          > >would a big try catch around the Application.Run () do the job? in my head
          > >that launches a thread and if that thread crashes somehow my try catch[/color][/color]
          wont[color=blue][color=green]
          > >do crap, maybe im wrong.
          > >So what do you guys do to capture a possible application crash?
          > >
          > >
          > >[/color]
          >
          >
          > Rakesh, EFT.
          >
          > This posting is provided "AS IS" with no warranties, and confers no[/color]
          rights.[color=blue]
          > Use of included script samples are subject to the terms specified at
          > http://www.microsoft.com/info/cpyright.htm
          >[/color]


          Comment

          Working...