• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 610
  • Last Modified:

VB.NET - Exception Catch - What line of code raised the exception?

When an exception is thrown and caught in my program, I'd like to know what line of code threw the exception.

Is there some way to do this?

Thanks
0
oxygen_728
Asked:
oxygen_728
2 Solutions
 
Éric MoreauSenior .Net ConsultantCommented:
have you checked the StackTrace property of your exception object?
0
 
thenrichCommented:
Try

''' You code here

 Catch ex As Exception
            MsgBox(ex.Message & chr(13) & ex.StackTrace)
End Try
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now