Home All Groups Group Topic Archive Search About
Author
28 Jun 2006 3:11 PM
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.

Author
28 Jun 2006 3:27 PM
IdleBrain
Hello Dave:
Choose Debug Menu-> Exceptions
Choose Break into Debugger for all the exceptions When the exception is
thrown.
Hope it helps.


dave m wrote:
Show quoteHide quote
> 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.
Author
28 Jun 2006 4:39 PM
admspam
IdleBrain wrote:
> 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.

Show quoteHide quote
> Hope it helps.
>
>
> dave m wrote:
> > 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.