Unhandled exception

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

    #1

    Unhandled exception

    Hi there,

    Im experiencing an unhandled exception that seems to be impossible for
    me to catch. I am launching an assembly of mine from within another
    assembly using the Process object. Once the process finishes it causes an
    unhandled exception, even though both host and child process have all thread
    exceptions handled.

    Unfortunately this is making debugging a complete and utter nightmare as
    the application has already terminated by the time the standard unhandled
    excaption dialog appears with this info in...

    EventType : clr20r3 P1 : <child assembly> P2 : 1.3.2323.22525
    P3 : 44648dad
    P4 : mscorlib P5 : 2.0.0.0 P6 : 4333ab80 P7 : 11d0 P8 : 27
    P9 : system.applicat ionexception

    Any ideas what this is supposed to mean exactly? It has no relevance to
    me but if I could just know what the exception is exactly then this could
    help, "applicationexc eption" doesn't help me in the slightest as i have 3
    assemblies that derive from said applicationexce ption that are being used
    during this process.

    I can only presume that this error could be down to the disposing of an
    object by the garbage collector, I cant think of any other reason why code
    would remain to be processed after the last line of code has been passed..

    Thanks loads in advance if anyone can help me with this.

    Nick.


  • NickP

    #2
    Re: Unhandled exception

    Hi there,

    Just to add, I've managed to get rid of the exception by disposing a
    specific object before the application exits. The object was only disposing
    a mutex so I'm not quite sure how this would cause an exception at garbage
    collection time.. Anyway, it's gone now so I guess I shouldn't complain!

    Nick.

    "NickP" <a@a.com> wrote in message
    news:uGTXPocdGH A.3908@TK2MSFTN GP04.phx.gbl...[color=blue]
    > Hi there,
    >
    > Im experiencing an unhandled exception that seems to be impossible for
    > me to catch. I am launching an assembly of mine from within another
    > assembly using the Process object. Once the process finishes it causes an
    > unhandled exception, even though both host and child process have all
    > thread exceptions handled.
    >
    > Unfortunately this is making debugging a complete and utter nightmare
    > as the application has already terminated by the time the standard
    > unhandled excaption dialog appears with this info in...
    >
    > EventType : clr20r3 P1 : <child assembly> P2 : 1.3.2323.22525
    > P3 : 44648dad
    > P4 : mscorlib P5 : 2.0.0.0 P6 : 4333ab80 P7 : 11d0 P8 : 27
    > P9 : system.applicat ionexception
    >
    > Any ideas what this is supposed to mean exactly? It has no relevance
    > to me but if I could just know what the exception is exactly then this
    > could help, "applicationexc eption" doesn't help me in the slightest as i
    > have 3 assemblies that derive from said applicationexce ption that are
    > being used during this process.
    >
    > I can only presume that this error could be down to the disposing of an
    > object by the garbage collector, I cant think of any other reason why code
    > would remain to be processed after the last line of code has been passed..
    >
    > Thanks loads in advance if anyone can help me with this.
    >
    > Nick.
    >[/color]


    Comment

    • jayeldee

      #3
      Re: Unhandled exception

      Nick,
      You could use the AppDomain object to register a handler for Unhandled
      Exceptions in your app, allowing you to see more detail about the
      problem you're occuring.


      Module Module1

      Sub Main()

      AddHandler AppDomain.Curre ntDomain.Unhand ledException,
      AddressOf Unhandled

      Throw New Exception("Unha ndled Exception")

      End Sub

      Private Sub Unhandled(ByVal sender As Object, ByVal e As
      UnhandledExcept ionEventArgs)

      Console.WriteLi ne("Unhandled Exception of Type " &
      e.ExceptionObje ct.GetType.ToSt ring)
      Console.WriteLi ne(e.ExceptionO bject.ToString)
      Console.ReadLin e()

      End Sub

      End Module


      john

      Comment

      • NickP

        #4
        Re: Unhandled exception

        Hi John,

        Indeed I have been, and also the thread exception. But neither would
        catch this exception, I believe it was because the application had already
        terminated and it was occuring during garbage collection. All sorted now
        though thankfully, cheers for your input.

        Nick.

        "jayeldee" <jayeldee@gmail .com> wrote in message
        news:1147443512 .715632.223120@ d71g2000cwd.goo glegroups.com.. .[color=blue]
        > Nick,
        > You could use the AppDomain object to register a handler for Unhandled
        > Exceptions in your app, allowing you to see more detail about the
        > problem you're occuring.
        >
        >
        > Module Module1
        >
        > Sub Main()
        >
        > AddHandler AppDomain.Curre ntDomain.Unhand ledException,
        > AddressOf Unhandled
        >
        > Throw New Exception("Unha ndled Exception")
        >
        > End Sub
        >
        > Private Sub Unhandled(ByVal sender As Object, ByVal e As
        > UnhandledExcept ionEventArgs)
        >
        > Console.WriteLi ne("Unhandled Exception of Type " &
        > e.ExceptionObje ct.GetType.ToSt ring)
        > Console.WriteLi ne(e.ExceptionO bject.ToString)
        > Console.ReadLin e()
        >
        > End Sub
        >
        > End Module
        >
        >
        > john
        >[/color]


        Comment

        Working...