Debugging at runtime

  • Thread starter Thread starter dave m
  • Start date Start date
D

dave m

Is it possible to have an application, compiled in debug mode, report what
line or linenumber caused an error or exception at runtime?

I'm using VS2003. I'd appriciate if anyone could point me in the right
direction.

Thanks,

Dave M.
 
Hello Dave:
Choose Debug Menu-> Exceptions
Choose Break into Debugger for all the exceptions When the exception is
thrown.
Hope it helps.
 
IdleBrain said:
Hello Dave:
Choose Debug Menu-> Exceptions
Choose Break into Debugger for all the exceptions When the exception is
thrown.

and then, just to be clear, in your code, do something like:
Try
'[the code you want to run goes here]
Catch ex As Exception
Console.Write ex.Message & " " & ex.StackTrace.ToString
End Try

The stack trace will have the line number and all sorts of other
helpful info.
 
Back
Top