Display Exception Stack Trace : Exception Stack « Development « VB.Net






Display Exception Stack Trace

Display Exception Stack Trace
Imports System

Public Class MainClass
    
    Shared Sub Main(ByVal args As String())
        Dim stack_trace As New System.Diagnostics.StackTrace(True)

        For i As Integer = 0 To stack_trace.FrameCount - 1
            With stack_trace.GetFrame(i)
                Console.WriteLine("Method: " & .GetMethod().ToString & _
                ", File: '" & _
                .GetFileName() & _
                "', Line: " & .GetFileLineNumber() )
            End With
        Next i
    End Sub
End Class

           
       








Related examples in the same category

1.Inner Exception DemoInner Exception Demo