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
oxygen_728Asked:
Who is Participating?
 
Éric MoreauConnect With a Mentor Senior .Net ConsultantCommented:
have you checked the StackTrace property of your exception object?
0
 
thenrichConnect With a Mentor Commented:
Try

''' You code here

 Catch ex As Exception
            MsgBox(ex.Message & chr(13) & ex.StackTrace)
End Try
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.