Displaying last command executed?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a wayin C#:

If a program errors and gets directed to the global asax file. I know you
can display the stack traces, line#s , methods, ect. Is there a way in code
to display the ACTUAL line of text that caused the error?

So I would actually see for example:
"Response.Write(Request["Message"].ToString());"

if that was the line that caused the error
 
Is there a wayin C#:

If a program errors and gets directed to the global asax file. I know you
can display the stack traces, line#s , methods, ect. Is there a way in code
to display the ACTUAL line of text that caused the error?

So I would actually see for example:
"Response.Write(Request["Message"].ToString());"

if that was the line that caused the error

Possibly, but only if the app is compiled in debug mode. When you
compile in release mode, optimizations may happen that prevent a 1:1
mapping between an IL instruction that caused an exception and a
particular line in your source code.
 
Back
Top