1
Answer

How to get Exception Error Exactly Line No ?

Kishore Kumar

Kishore Kumar

9y
760
1
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)