Solved

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

Posted on 2008-06-09
2
596 Views
Last Modified: 2008-06-10
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
Comment
Question by:oxygen_728
2 Comments
 
LVL 69

Accepted Solution

by:
Éric Moreau earned 250 total points
Comment Utility
have you checked the StackTrace property of your exception object?
0
 
LVL 5

Assisted Solution

by:thenrich
thenrich earned 250 total points
Comment Utility
Try

''' You code here

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now