M
Mark Kamoski
Hi Everyone--
How can one get the line number of where an error was thrown and/or caught?
For example, note the following, for use at any given point in a piece of
code:
....to get the current Assembly's name, one can use this...
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
....and, to get the current class's name, one can use this...
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
....and, to get the current method's name, one can use this...
System.Reflection.MethodBase.GetCurrentMethod().Name
....BUT...
....to get the line number of where an error was thrown and/or caught one
can use???
WHAT?
Any ideas?
(Note that, in short, I would like to get the line number the same way as
when DotNet reports an unhandled exception, where it gives the line number
of the break.)
Please advise.
Thank you.
--Mark
How can one get the line number of where an error was thrown and/or caught?
For example, note the following, for use at any given point in a piece of
code:
....to get the current Assembly's name, one can use this...
System.Reflection.Assembly.GetExecutingAssembly().GetName().Name
....and, to get the current class's name, one can use this...
System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.Name
....and, to get the current method's name, one can use this...
System.Reflection.MethodBase.GetCurrentMethod().Name
....BUT...
....to get the line number of where an error was thrown and/or caught one
can use???
WHAT?
Any ideas?
(Note that, in short, I would like to get the line number the same way as
when DotNet reports an unhandled exception, where it gives the line number
of the break.)
Please advise.
Thank you.
--Mark