Kishore Kumar

Kishore Kumar

  • NA
  • 31
  • 20.5k

How to get Exception Error Exactly Line No ?

Sep 14 2015 5:59 AM
Hi,
I am written (ASP.NET)  below the code for getting exception Line number

string errorLine;
StackTrace st = new StackTrace(0, true);
StackFrame sf = new StackFrame();
sf = st.GetFrame(0);
errorLine = sf.GetFileLineNumber().ToString();

But, I am not getting exactly exception line no. different line no is came

Answers (1)